From a6ae7d9d2d2f927739a0c5979caedab022b1e535 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Thu, 6 Nov 2025 09:56:15 +0000 Subject: [PATCH] gnu: python-strenum: Enable tests. * gnu/packages/python-xyz.scm (python-strenum)[source]: Switch to git-fetch providing tests. [arguments] : Extract some test options from "pytest.ini" : Add 'fix-version, and 'fix-pytest-config. [native-inputs]: Remove python-wheel; add python-pytest. Change-Id: I2c0207f87121f8e23d007ff201a05af98fe41381 --- gnu/packages/python-xyz.scm | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 5519711ea3ac126313e44912172e52ef618c7e4a..6d0bdb9744034c2545a20e9c8cf59927922c7d55 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -17206,13 +17206,33 @@ functionality and customization to your projects with their own plugins.") (version "0.4.15") (source (origin - (method url-fetch) - (uri (pypi-uri "StrEnum" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/irgeek/StrEnum") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "1zrfr1shin5wyfnfxc7jpk013594wasrp4ni9l70fhjlf2mvb3w7")))) + (base32 "1bvk7v5f3sr7awcacdmw5lfzsnn6j52q45va9xpc71n5qxydqbfn")))) (build-system pyproject-build-system) - (arguments (list #:tests? #false)) ;there are none. - (native-inputs (list python-setuptools python-wheel)) + (arguments + (list + #:test-flags + #~(list "--ignore=doc/") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-version + ;; Versioneer is useless when there is no git metadata. + (lambda _ + (substitute* "setup.py" + (("version=versioneer.get_version\\(),") + (format #f "version=~s," #$version))))) + (add-after 'unpack 'fix-pytest-config + (lambda _ + (substitute* "pytest.ini" + (("addopts =.*") ""))))))) + (native-inputs + (list python-pytest + python-setuptools)) (home-page "https://github.com/irgeek/StrEnum") (synopsis "Enum that inherits from str") (description "StrEnum is a Python @code{enum.Enum} that inherits from