gnu: python-aenum: Update to 3.1.15.

* gnu/packages/python-xyz.scm (python-aenum): Update to 3.1.15.
[build-system]: Switch to pyproject.
[arguments] <phases>: Use default 'check; add 'fix-tests.
<test-flags>: Skip 3 failing tests.
[native-inputs]: Add python-pytest, python-setuptools, and python-wheel.
[home-page]: Fix it, Bitbucket's one no longer exists, current one was
taken from <https://pypi.org/project/aenum/>.

Change-Id: I43994aac2ea688a63066ee8c8aa1855c51632ac2
This commit is contained in:
Sharlatan Hellseher 2025-04-10 09:03:12 +01:00 committed by Andreas Enge
parent 4c08d7037a
commit 149905f81b
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

@ -4543,43 +4543,55 @@ helpers.")
language. It aims to be fast.") language. It aims to be fast.")
(license license:expat))) (license license:expat)))
;; XXX: The project might be abandoned and this package has no users in Guix,
;; consider to remove if it keeps failing.
;; See: <https://github.com/ethanfurman/aenum/issues/45>,
;; <https://github.com/ethanfurman/aenum/issues/44>,
;; <https://github.com/ethanfurman/aenum/issues/27>.
(define-public python-aenum (define-public python-aenum
(package (package
(name "python-aenum") (name "python-aenum")
(version "3.1.12") (version "3.1.15")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "aenum" version)) (uri (pypi-uri "aenum" version))
(sha256 (sha256
(base32 "1w1ffkcxgnimi5w8802qk6w2qxz9k8hpvsg6yy2zi08ahs8iqlry")) (base32 "0ncmbdblqhqyb2mg73d5663vx3q2xb9q8hmj77zp1y64336pdgcc"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
;; Delete the Python 2 specific files which won't compile ;; Delete the Python 2 specific files which won't compile
;; in Python 3. ;; in Python 3.
'(for-each delete-file (find-files "." "_py2.py$"))))) '(for-each delete-file (find-files "." "_py2.py$")))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
`(#:phases (modify-phases %standard-phases (list
(replace 'check #:test-flags
(lambda _ ;; These tests are defined in "aenum/test_v3.py" and require a function
;; We must run the test suite module directly, as it ;; "test_pickle_dump_load" from "aenum/test.py" which is not imported
;; fails to define the 'tempdir' variable in scope for ;; into the module's scope.
;; the tests otherwise #~(list "-k" (string-join
;; (see:https://bitbucket.org/stoneleaf/aenum/\ (list "not test_pickle_enum_function_with_qualname"
;; issues/32/running-tests-with-python-setuppy-test). "test_class_nested_enum_and_pickle_protocol_four"
(invoke "python3" "aenum/test.py") "test_subclasses_with_getnewargs_ex")
;; This one fails with "NameError: name " and not "))
;; 'test_pickle_dump_load' is not defined" (see: #:phases
;; https://bitbucket.org/stoneleaf/aenum/issues/33 #~(modify-phases %standard-phases
;; /error-running-the-test_v3py-test-suite). (add-after 'unpack 'fix-tests
;; (invoke "python3" "aenum/test_v3.py") (lambda _
#t))))) (substitute* "aenum/test_v3.py"
(home-page "https://bitbucket.org/stoneleaf/aenum") ;; tempdir variable is not defined in the module.
(("import tempfile.*")
(format #f "import tempfile~%tempdir = tempfile.mkdtemp()~%"))))))))
(native-inputs
(list python-pytest
python-setuptools
python-wheel))
(home-page "https://github.com/ethanfurman/aenum")
(synopsis "Advanced enumerations, namedtuples and constants for Python") (synopsis "Advanced enumerations, namedtuples and constants for Python")
(description "The aenum library includes an @code{Enum} base class, a (description
metaclass-based @code{NamedTuple} implementation and a @code{NamedConstant} "The aenum library includes an @code{Enum} base class, a metaclass-based
class.") @code{NamedTuple} implementation and a @code{NamedConstant} class.")
(license license:bsd-3))) (license license:bsd-3)))
(define-public python-calver (define-public python-calver