gnu: snakemake-6: Fix version reporting.

* gnu/packages/python-xyz.scm (snakemake-6)[arguments]: Add phase
'patch-version and use G-exp.
[build-system]: Use pyproject-build-system.
This commit is contained in:
Ricardo Wurmus 2023-08-01 08:17:27 +02:00
parent a3f4ccfebd
commit 896b40d2ca
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -11443,10 +11443,11 @@ Python style, together with a fast and comfortable execution environment.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "09yrpi9f86r9yvcm2dfjs5zy87c4j31bxama77kfd6y8yfrrjlai")))) (base32 "09yrpi9f86r9yvcm2dfjs5zy87c4j31bxama77kfd6y8yfrrjlai"))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
'(#:phases (list
(modify-phases %standard-phases #:phases
#~(modify-phases %standard-phases
;; For cluster execution Snakemake will call Python. Since there is ;; For cluster execution Snakemake will call Python. Since there is
;; no suitable GUIX_PYTHONPATH set, cluster execution will fail. We ;; no suitable GUIX_PYTHONPATH set, cluster execution will fail. We
;; fix this by calling the snakemake wrapper instead. ;; fix this by calling the snakemake wrapper instead.
@ -11457,8 +11458,15 @@ Python style, together with a fast and comfortable execution environment.")
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(substitute* "snakemake/executors/__init__.py" (substitute* "snakemake/executors/__init__.py"
(("\\{sys.executable\\} -m snakemake") (("\\{sys.executable\\} -m snakemake")
(string-append (assoc-ref outputs "out") (string-append #$output "/bin/snakemake")))))
"/bin/snakemake"))))) (add-after 'unpack 'patch-version
(lambda _
(substitute* "setup.py"
(("version=versioneer.get_version\\(\\)")
(format #f "version=~s" #$version)))
(substitute* '("snakemake/_version.py"
"versioneer.py")
(("0\\+unknown") #$version))))
(replace 'check (replace 'check
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(when tests? (when tests?