python-pycurl fails to build with Python 3.10.0a1. RPM build errors: src/easyperform.c: In function ‘do_curl_perform_rb’: src/easyperform.c:31:5: warning: ‘PyEval_CallObjectWithKeywords’ is deprecated [-Wdeprecated-declarations] 31 | io = PyEval_CallObject(bytesio, NULL); | ^~ In file included from /usr/include/python3.10/Python.h:146, from src/pycurl.h:5, from src/easyperform.c:1: /usr/include/python3.10/ceval.h:17:43: note: declared here 17 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/module.c: In function ‘PyInit_pycurl’: src/module.c:353:25: error: lvalue required as left operand of assignment 353 | Py_TYPE(&Curl_Type) = &PyType_Type; | ^ src/module.c:354:30: error: lvalue required as left operand of assignment 354 | Py_TYPE(&CurlMulti_Type) = &PyType_Type; | ^ src/module.c:355:30: error: lvalue required as left operand of assignment 355 | Py_TYPE(&CurlShare_Type) = &PyType_Type; | ^ src/module.c:1406:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations] 1406 | PyEval_InitThreads(); | ^~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.10/Python.h:146, from src/pycurl.h:5, from src/module.c:1: /usr/include/python3.10/ceval.h:122:37: note: declared here 122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~~~~~~~~~~~~~ For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01715017-python-pycurl/ For all our attempts to build python-pycurl with Python 3.10, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-pycurl/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/ Let us know here if you have any questions. Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
https://docs.python.org/3.10/whatsnew/3.10.html#id2 Since Py_TYPE() is changed to the inline static function, Py_TYPE(obj) = new_type must be replaced with Py_SET_TYPE(obj, new_type): see Py_SET_TYPE() (available since Python 3.9). For backward compatibility, this macro can be used: #if PY_VERSION_HEX < 0x030900A4 # define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0) #endif https://bugs.python.org/issue39573
Why do python developers do backward-incompatible changes in minor updates?
Python's versioning predates semver. As with any Y-release, 3.10 will have some backward incompatibilities.
In other words, 3.9 -> 3.10 is not considered a "minor" update. See for example the release of Python 3.9.0: https://www.python.org/downloads/release/python-390/ "Python 3.9.0 is the newest major release of the Python programming language..."
I wish we sticked to a more stable technology. Porting everything to a new major release of python all the time is utterly wasteful. I have opened a pull request upstream to fix this: https://github.com/pycurl/pycurl/pull/660
For this particular change, I've queried upstream about its necessity: https://bugs.python.org/issue39573#msg379675 I would also like Python to be more stable. Thanks for the PR, Kamil.
upstream commit: https://github.com/pycurl/pycurl/commit/c4036bdc dist-git commit: https://src.fedoraproject.org/rpms/python-pycurl/c/2492f5a6
*** Bug 1891754 has been marked as a duplicate of this bug. ***
JFYI The change was reverted in Python 3.10, because it caused too much trouble (the amount of affected Fedora packages was too big). This comment is mass posted in all relevant bugzillas. If you already worked upstream to fix the problem, you might want to let them know about the revert, but the new way of doing things also works. Sorry for the trouble and thanks again for the fix. https://github.com/python/cpython/commit/0e2ac21dd