diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-12-20 14:23:42 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-10 11:44:41 -0500 |
commit | 3307224bf918ec59939045c68a7dc80483ca682e (patch) | |
tree | f8c4f00f58b08c9fd6ddd6c6ff3aee9c9210ed87 /gnu/packages/check.scm | |
parent | 84558f252ebb9f79c8deef8a0aa52b41e3c6f664 (diff) |
gnu: python-testpath: Update to 0.5.0 and enable tests.
* gnu/packages/check.scm (python-testpath): Update to 0.5.0.
[phases]{relax-requirements}: New phase
{build}: Build using pypa-build's 'build' command.
{check}: Override phase.
{install}: Adjust.
[native-inputs]: Remove python-flit. Add python-pypa-build and python-pytest.
[home-page]: Update.
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r-- | gnu/packages/check.scm | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 194bdf20ad..5dcf8958f1 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -79,6 +79,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system glib-or-gtk) @@ -1865,7 +1866,7 @@ C/C++, R, and more, and uploads it to the @code{codecov.io} service.") (define-public python-testpath (package (name "python-testpath") - (version "0.4.4") + (version "0.5.0") (source (origin (method git-fetch) @@ -1875,35 +1876,33 @@ C/C++, R, and more, and uploads it to the @code{codecov.io} service.") (file-name (git-file-name name version)) (sha256 (base32 - "1fwv4d3p54xx1x942s104irr35lszvv6jnr4nn1scsfvc0m1qmbk")))) + "08r1c6bhvj8pcdvzkqv1950k36a6q3v81fd2p1yqdq3c07mcwgif")))) (build-system python-build-system) (arguments - `(#:tests? #f ; this package does not even have a setup.py - #:modules ((guix build python-build-system) - (guix build utils) - (srfi srfi-1)) - #:phases - (modify-phases %standard-phases - (replace 'build - (lambda _ - ;; A ZIP archive should be generated, but it fails with "ZIP does - ;; not support timestamps before 1980". Luckily, - ;; SOURCE_DATE_EPOCH is respected, which we set to some time in - ;; 1980. - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "flit" "build"))) - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (add-installed-pythonpath inputs outputs) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (wheel) - (format #true wheel) - (invoke "python" "-m" "pip" "install" - wheel (string-append "--prefix=" out))) - (find-files "dist" "\\.whl$")))))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'relax-requirements + (lambda _ + (substitute* "pyproject.toml" + (("flit_core >=3.2.0,<3.3") + "flit_core >=3.2.0")))) + ;; XXX: PEP 517 manual build copied from python-isort. + (replace 'build + (lambda _ + (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest")))) + (replace 'install + (lambda _ + (let ((whl (car (find-files "dist" "\\.whl$")))) + (invoke "pip" "--no-cache-dir" "--no-input" + "install" "--no-deps" "--prefix" #$output whl))))))) (native-inputs - (list python-flit)) - (home-page "https://github.com/takluyver/testpath") + (list python-pypa-build python-flit-core python-pytest)) + (home-page "https://github.com/jupyter/testpath") (synopsis "Test utilities for code working with files and commands") (description "Testpath is a collection of utilities for Python code working with files |