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.
This commit is contained in:
Maxim Cournoyer 2021-12-20 14:23:42 -05:00
parent 84558f252e
commit 3307224bf9
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -79,6 +79,7 @@ (define-module (gnu packages check)
#: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 @@ (define-public python-codecov
(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 @@ (define-public python-testpath
(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