public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/astrometry] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
@ 2026-08-06 18:27 Jitka Plesnikova
0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-08-06 18:27 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/astrometry
Branch : rawhide
Commit : eb38925935eb1ba9dac564f2389c992b4320ab48
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date : 2026-07-28T15:29:18+02:00
Stats : +113/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/astrometry/c/eb38925935eb1ba9dac564f2389c992b4320ab48?branch=rawhide
Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
---
diff --git a/Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch b/Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
new file mode 100644
index 0000000..f0a1776
--- /dev/null
+++ b/Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
@@ -0,0 +1,110 @@
+diff -up astrometry.net-0.98/libkd/pyspherematch.c.swig45 astrometry.net-0.98/libkd/pyspherematch.c
+--- astrometry.net-0.98/libkd/pyspherematch.c.swig45 2026-07-27 16:59:31.982121322 +0200
++++ astrometry.net-0.98/libkd/pyspherematch.c 2026-07-27 16:59:31.988237938 +0200
+@@ -7,7 +7,7 @@
+
+ #if PY_MAJOR_VERSION >= 3
+ #define IS_PY3K
+-#define PyInt_FromLong PyLong_FromLong
++#define PyLong_FromLong PyLong_FromLong
+ #endif
+
+ #include <stdio.h>
+@@ -458,7 +458,7 @@ static PyMethodDef kdtree_methods[] = {
+ };
+
+ static PyObject* KdTree_n(KdObject* self, void* closure) {
+- return PyInt_FromLong(kdtree_n(self->kd));
++ return PyLong_FromLong(kdtree_n(self->kd));
+ }
+
+ static PyObject* KdTree_bbox(KdObject* self, void* closure) {
+@@ -564,9 +564,9 @@ static void callback_dualtree2(void* v,
+ lst = PyList_New(1);
+ // SetItem steals a ref -- that's what we want.
+ PyList_SetItem(dt->indlist, ind1, lst);
+- PyList_SET_ITEM(lst, 0, PyInt_FromLong(ind2));
++ PyList_SET_ITEM(lst, 0, PyLong_FromLong(ind2));
+ } else {
+- PyList_Append(lst, PyInt_FromLong(ind2));
++ PyList_Append(lst, PyLong_FromLong(ind2));
+ }
+ }
+
+diff -up astrometry.net-0.98/plot/plotstuff.i.swig45 astrometry.net-0.98/plot/plotstuff.i
+--- astrometry.net-0.98/plot/plotstuff.i.swig45 2026-07-27 16:59:31.983121343 +0200
++++ astrometry.net-0.98/plot/plotstuff.i 2026-07-27 17:16:11.176233377 +0200
+@@ -125,7 +125,7 @@ void free(void* ptr);
+ Py_DECREF($result);
+ $result = PyList_New(3);
+ for (i=0; i<3; i++) {
+- PyObject *o = PyInt_FromLong((long)$1[i]);
++ PyObject *o = PyLong_FromLong((long)$1[i]);
+ PyList_SetItem($result,i,o);
+ }
+ }
+@@ -142,7 +142,7 @@ void free(void* ptr);
+ for (i=0; i<3; i++) {
+ PyObject *o = PySequence_GetItem($input, i);
+ if (PyNumber_Check(o)) {
+- temp[i] = (int)PyInt_AsLong(o);
++ temp[i] = (int)PyLong_AsLong(o);
+ } else {
+ PyErr_SetString(PyExc_ValueError,"Sequence elements must be numbers");
+ return NULL;
+diff -up astrometry.net-0.98/util/index_pyutils.c.swig45 astrometry.net-0.98/util/index_pyutils.c
+--- astrometry.net-0.98/util/index_pyutils.c.swig45 2026-07-27 16:59:31.985121387 +0200
++++ astrometry.net-0.98/util/index_pyutils.c 2026-07-27 16:59:31.989357569 +0200
+@@ -70,7 +70,7 @@ static PyObject* qidxfile_get_quad_list(
+ static PyObject* pyval_int(void* v, int index) {
+ PyObject* pyval;
+ int* i = (int*)v;
+- pyval = PyInt_FromLong((long)i[index]);
++ pyval = PyLong_FromLong((long)i[index]);
+ assert(pyval);
+ return pyval;
+ }
+diff -up astrometry.net-0.98/util/util.i.swig45 astrometry.net-0.98/util/util.i
+--- astrometry.net-0.98/util/util.i.swig45 2026-07-27 16:59:31.986121408 +0200
++++ astrometry.net-0.98/util/util.i 2026-07-27 17:16:11.177220170 +0200
+@@ -915,7 +915,7 @@ def lanczos_shift_image(img, dx, dy, ord
+ D = $1->dimquads;
+ $result = PyList_New(D);
+ for (i = 0; i < D; i++) {
+- PyObject *o = PyInt_FromLong($3[i]);
++ PyObject *o = PyLong_FromLong($3[i]);
+ PyList_SetItem($result, i, o);
+ }
+ }
+@@ -990,11 +990,11 @@ long quadfile_addr(index_t* ind);
+ int i;
+ int nn;
+ // convert $result to nn
+- //nn = (int)PyInt_AsLong($result);
++ //nn = (int)PyLong_AsLong($result);
+ nn = result;
+ $result = PyList_New(nn);
+ for (i = 0; i < nn; i++) {
+- PyObject *o = PyInt_FromLong($1[i]);
++ PyObject *o = PyLong_FromLong($1[i]);
+ PyList_SetItem($result, i, o);
+ }
+ }
+@@ -1012,7 +1012,7 @@ long quadfile_addr(index_t* ind);
+ N = il_size($1);
+ $result = PyList_New(N);
+ for (i = 0; i < N; i++) {
+- PyObject *o = PyInt_FromLong(il_get($1, i));
++ PyObject *o = PyLong_FromLong(il_get($1, i));
+ PyList_SetItem($result, i, o);
+ }
+ }
+@@ -2290,7 +2290,7 @@ static PyObject* anwcs_xy2rd_wrapper(con
+ d = *(double*)PyArray_DATA((PyArrayObject*)py);
+ py = PyFloat_FromDouble(d);
+ i = *(int*)PyArray_DATA((PyArrayObject*)pok);
+- pok = PyInt_FromLong(i);
++ pok = PyLong_FromLong(i);
+ ret = Py_BuildValue("(NNN)", pok, px, py);
+ } else {
+ // Grab the results -- note "4,2,3" order -- ok,x,y
diff --git a/astrometry.spec b/astrometry.spec
index 04df1e3..423a4d3 100644
--- a/astrometry.spec
+++ b/astrometry.spec
@@ -64,6 +64,9 @@ Patch: Fix-shared-lib-flags-so-that-the-package-can-be-built-on-s390x.p
Patch: Don-t-copy-demo-files-to-examples.patch
Patch: Remove-errornous-generation-of-net-client.py.patch
Patch: Remove-horizons.py-from-Python-package.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch: Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch
BuildRequires: gcc
BuildRequires: make
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-06 18:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-06 18:27 [rpms/astrometry] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility Jitka Plesnikova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox