gnu: python-preshed: Switch to pyproject.

* gnu/packages/python-xyz.scm (python-preshed):
[build-system]: Switch to pyproject-build-system.
[native-inputs]: Add python-setuptools.
[source]: Switch to git-fetch.
[build-system]: Switch to pyproject-build-system.
[arguments]: Remove former <#:modules> and <#:phases>, not necessary
due to the switch to git-fetch.
<#:phases>: Replace 'check phase, to run it from the output and delete
it afterwards. This is necessary because tests import modules using
relative names, and the modules are compiled.  Add phase
'patch-msvccompiler.
[native-inputs]: Add python-setuptools.

Change-Id: I8524c7257d9f41545e3e03d5c676c0534651aece
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves
2025-11-22 15:03:59 +01:00
committed by Sharlatan Hellseher
parent cd49d8141d
commit 7516485525

View File

@@ -35122,28 +35122,36 @@ when the object is garbage collected.")
(package (package
(name "python-preshed") (name "python-preshed")
(version "3.0.6") (version "3.0.6")
(source (origin (source
(method url-fetch) (origin
(uri (pypi-uri "preshed" version)) (method git-fetch)
(sha256 (uri (git-reference
(base32 (url "https://github.com/explosion/preshed")
"0akpydd23xqxx9d04drsnw9140rb3cv07r1zpzqz5wm0lf47afzv")))) (commit (string-append "v" version))))
(build-system python-build-system) (file-name (git-file-name name version))
(native-inputs (list python-cython python-cymem python-pytest)) (sha256
(inputs (list python python-cymem python-murmurhash)) (base32 "01xwczc4cb9q3iah1gb9lxfh9s8ix695y3s95j7nhbiws6c9b5k5"))))
(build-system pyproject-build-system)
(arguments (arguments
(list #:modules (list
'((ice-9 ftw) (ice-9 match) #:phases
(guix build utils) #~(modify-phases %standard-phases
(guix build python-build-system)) (add-after 'unpack 'patch-msvccompiler
#:phases (lambda _
#~(modify-phases %standard-phases (substitute* "setup.py"
(add-after 'unpack 'set-source-file-times-to-1980 (("from distutils import ccompiler, msvccompiler")
(lambda _ "from distutils import ccompiler")
(let ((circa-1980 (* 10 366 24 60 60))) (("and msvccompiler.*")
(ftw "." ""))))
(lambda (file stat flag) (replace 'check
(utime file circa-1980 circa-1980) #t)))))))) (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
(with-directory-excursion (site-packages inputs outputs)
(for-each delete-file (find-files "." "\\.pyx$"))
(apply (assoc-ref %standard-phases 'check) args)
(delete-file-recursively "preshed/tests")))))))
(native-inputs
(list python-cython python-cymem python-pytest python-setuptools))
(inputs (list python python-cymem python-murmurhash))
(home-page "https://github.com/explosion/preshed") (home-page "https://github.com/explosion/preshed")
(synopsis "Cython hash tables that assume keys are pre-hashed") (synopsis "Cython hash tables that assume keys are pre-hashed")
(description (description