guix_mirror_bot pushed a commit to branch python-team
in repository guix.
commit 3cbcabc9518c2116932ac8841ceb03945b1f0ab6
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Fri Jul 11 12:49:45 2025 +0100
gnu: Set default python-cython to v3:
According to CHANGELOG v3 is no longer alpha or betta verion and current
stable, this change set v3 as default.
See: <https://github.com/cython/cython/blob/master/CHANGES.rst>.
* gnu/packages/python-xyz.scm (python-cython): Update to 3.1.2.
(python-cython-0): New variable, inherit from python-cython.
(python-cython-0.29.35): Inherit from python-cython-0.
(python-cython-3): Deprecate variable.
Change-Id: Ia9fe229bf2e1ee2e4b434934e978195fd0b3adb6
---
gnu/packages/python-xyz.scm | 143 ++++++++++++++++++++++----------------------
1 file changed, 70 insertions(+), 73 deletions(-)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d785b504c5..76d5c76552 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -9962,23 +9962,83 @@ For some datatypes the overhead can be reduced by using
khash by factor 4-8.")
(license license:expat)))
(define-public python-cython
+ ;; TODO: Move to python-build.
(package
(name "python-cython")
- (version "0.29.32")
+ (version "3.1.2")
(source
(origin
(method url-fetch)
- (uri (pypi-uri "Cython" version))
+ (uri (pypi-uri "cython" version))
(sha256
- (base32 "1xqsihpqnfal29nb5kmw8z71nd4jbsnbz7p3lkr094xpb13wycw7"))))
- (build-system python-build-system)
+ (base32 "108k6gsn63qkz98xhnm4440ir9ab0lxmw0gcrpz2sxm67yapmgvb"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags
+ #~(list "-vv"
+ "-j" (number->string (parallel-job-count))
+ "-x" (string-join
+ (list "annotate_html"
+ "Debugger"
+ ;; It introduces cycle.
+ "numpy_test"
+ ;; It fails with AssertionError: Failed doctest test
+ ;; for complex_numbers_cpp.double_abs.
+ "complex_numbers_cpp"
+ ;; This test fails when running on 24 cores.
+ "cpp_stl_conversion"
+ ;; XXX: On 32-bit architectures, running the
+ ;; parallel tests fails on many-core systems, see
+ ;; <https://github.com/cython/cython/issues/2807>.
+ #$@(if (not (target-64bit?))
+ '("run.parallel")
+ '())
+ #$@(if (system-hurd?)
+ '("test_class_ref"
+ "test_compiler_directives"
+ "test_lang_version")
+ '()))
+ "|"))
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? test-flags #:allow-other-keys)
+ ;; Disable compiler optimizations to greatly reduce the running
+ ;; time of the test suite.
+ (setenv "CFLAGS" "-O0")
+ ;; Some tests require access to "$HOME/.cython".
+ (setenv "HOME" "/tmp")
+ (when tests?
+ (apply invoke "python" "runtests.py" test-flags)))))))
+ (native-inputs
+ (list libxcrypt
+ python-setuptools
+ python-wheel))
;; we need the full python package and not just the python-wrapper
;; because we need libpython3.3m.so
(inputs
(list python))
- (native-inputs
- ;; Needed for some tests that link against it.
- (list libxcrypt))
+ (properties '())
+(home-page "https://cython.org/")
+(synopsis "C extensions for Python")
+(description "Cython is an optimising static compiler for both the Python
+programming language and the extended Cython programming language. It makes
+writing C extensions for Python as easy as Python itself.")
+(license license:asl2.0)))
+
+(define-public python-cython-0
+ (package
+ (inherit python-cython)
+ (name "python-cython")
+ (version "0.29.32")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "Cython" version))
+ (sha256
+ (base32 "1xqsihpqnfal29nb5kmw8z71nd4jbsnbz7p3lkr094xpb13wycw7"))))
+ (build-system python-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
@@ -9990,7 +10050,6 @@ For some datatypes the overhead can be reduced by using
khash by factor 4-8.")
;; Disable compiler optimizations to greatly reduce the running
;; time of the test suite.
(setenv "CFLAGS" "-O0")
-
(when tests?
(invoke "python" "runtests.py" "-vv"
"-j" (number->string (parallel-job-count))
@@ -10006,18 +10065,12 @@ For some datatypes the overhead can be reduced by
using khash by factor 4-8.")
"-x" "test_lang_version")
'())
;; This test fails when running on 24 cores.
- "-x" "cpp_stl_conversion")))))))
- (home-page "https://cython.org/")
- (synopsis "C extensions for Python")
- (description "Cython is an optimising static compiler for both the Python
-programming language and the extended Cython programming language. It makes
-writing C extensions for Python as easy as Python itself.")
- (license license:asl2.0)))
+ "-x" "cpp_stl_conversion")))))))))
;; Needed for scipy
(define-public python-cython-0.29.35
(package
- (inherit python-cython)
+ (inherit python-cython-0)
(name "python-cython")
(version "0.29.35")
(source (origin
@@ -10029,63 +10082,7 @@ writing C extensions for Python as easy as Python
itself.")
(properties '())))
(define-public python-cython-3
- (package
- (inherit python-cython)
- ;; Cython 3.x is the current stable version, however there are still a lot
- ;; of packages, which depend on `python-cython` package. Those need to be
- ;; upgraded.
- (name "python-cython-next")
- (version "3.1.2")
- (source (origin
- (method url-fetch)
- (uri (pypi-uri "cython" version))
- (sha256
- (base32
- "108k6gsn63qkz98xhnm4440ir9ab0lxmw0gcrpz2sxm67yapmgvb"))))
- (build-system pyproject-build-system)
- (arguments
- (list
- #:test-flags
- #~(list "-vv"
- "-j" (number->string (parallel-job-count))
- "-x" (string-join
- (list "annotate_html"
- "Debugger"
- ;; It introduces cycle.
- "numpy_test"
- ;; It fails with AssertionError: Failed doctest test
- ;; for complex_numbers_cpp.double_abs.
- "complex_numbers_cpp"
- ;; This test fails when running on 24 cores.
- "cpp_stl_conversion"
- ;; XXX: On 32-bit architectures, running the
- ;; parallel tests fails on many-core systems, see
- ;; <https://github.com/cython/cython/issues/2807>.
- #$@(if (not (target-64bit?))
- '("run.parallel")
- '())
- #$@(if (system-hurd?)
- '("test_class_ref"
- "test_compiler_directives"
- "test_lang_version")
- '()))
- "|"))
- #:phases
- #~(modify-phases %standard-phases
- (replace 'check
- (lambda* (#:key tests? test-flags #:allow-other-keys)
- ;; Disable compiler optimizations to greatly reduce the running
- ;; time of the test suite.
- (setenv "CFLAGS" "-O0")
- ;; Some tests require access to "$HOME/.cython".
- (setenv "HOME" "/tmp")
- (when tests?
- (apply invoke "python" "runtests.py" test-flags)))))))
- (native-inputs
- (list libxcrypt
- python-setuptools
- python-wheel))
- (properties '())))
+ (deprecated-package "python-cython-next" python-cython))
;; NOTE: when upgrading numpy please make sure that python-numba,
;; python-pandas and python-scipy still build, as these three packages are