gnu: snakemake-7: Fix version reporting.

* gnu/packages/python-xyz.scm (snakemake-7)[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:18:36 +02:00
parent 896b40d2ca
commit f872482043
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -11519,32 +11519,41 @@ (define-public snakemake-7
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "1qrqbmx4cbis0wxr6dl2rdjv9v627sbirsz6v5c31vlbqwkvs04q")))) (base32 "1qrqbmx4cbis0wxr6dl2rdjv9v627sbirsz6v5c31vlbqwkvs04q"))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
'(#:phases (list
(modify-phases %standard-phases #:phases
;; For cluster execution Snakemake will call Python. Since there is #~(modify-phases %standard-phases
;; no suitable GUIX_PYTHONPATH set, cluster execution will fail. We ;; For cluster execution Snakemake will call Python. Since there is
;; fix this by calling the snakemake wrapper instead. ;; no suitable GUIX_PYTHONPATH set, cluster execution will fail. We
(add-after 'unpack 'call-wrapper-not-wrapped-snakemake ;; fix this by calling the snakemake wrapper instead.
(lambda* (#:key outputs #:allow-other-keys) (add-after 'unpack 'call-wrapper-not-wrapped-snakemake
(substitute* "snakemake/executors/__init__.py" (lambda* (#:key outputs #:allow-other-keys)
(("self\\.get_python_executable\\(\\),") (substitute* "snakemake/executors/__init__.py"
"") (("self\\.get_python_executable\\(\\),")
(("\"-m snakemake\"") "")
(string-append "\"" (assoc-ref outputs "out") (("\"-m snakemake\"")
"/bin/snakemake" "\""))))) (string-append "\"" #$output
(replace 'check "/bin/snakemake" "\"")))))
(lambda* (#:key tests? #:allow-other-keys) (add-after 'unpack 'patch-version
(when tests? (lambda _
(setenv "HOME" "/tmp") (substitute* "setup.py"
;; This test attempts to change S3 buckets on AWS and fails (("version=versioneer.get_version\\(\\)")
;; because there are no AWS credentials. (format #f "version=~s" #$version)))
(delete-file "tests/test_tibanna.py") (substitute* '("snakemake/_version.py"
;; It's a similar story with this test, which requires access "versioneer.py")
;; to the Google Storage service. (("0\\+unknown") #$version))))
(delete-file "tests/test_google_lifesciences.py") (replace 'check
(invoke "pytest"))))))) (lambda* (#:key tests? #:allow-other-keys)
(when tests?
(setenv "HOME" "/tmp")
;; This test attempts to change S3 buckets on AWS and fails
;; because there are no AWS credentials.
(delete-file "tests/test_tibanna.py")
;; It's a similar story with this test, which requires access
;; to the Google Storage service.
(delete-file "tests/test_google_lifesciences.py")
(invoke "pytest")))))))
(propagated-inputs (propagated-inputs
(list python-appdirs (list python-appdirs
python-configargparse python-configargparse