aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2022-12-12 21:40:53 +0100
committerRicardo Wurmus <rekado@elephly.net>2022-12-12 23:59:29 +0100
commitc4bcb5db49b210097c5452b678e57a0774014814 (patch)
tree765c51a744a91c4ebd3500f18dbe530c51c49c2f /gnu
parent1d160f41f5e973ea2bbbf8bc80d216b5d9b0974c (diff)
downloadguix-c4bcb5db49b210097c5452b678e57a0774014814.tar
guix-c4bcb5db49b210097c5452b678e57a0774014814.tar.gz
gnu: python-typer: Simplify by using pyproject-build-system.
* gnu/packages/python-xyz.scm (python-typer)[build-system]: Use pyproject-build-system. [arguments]: Remove extra quoting; remove custom 'build phase; remove custom 'install phase; remove custom 'check phase; add 'pre-check phase. [synopsis]: Pull onto the same line. [description]: Reformat.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-xyz.scm74
1 files changed, 28 insertions, 46 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9629012a80..bb25c35caf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22311,60 +22311,42 @@ based on the CPython 2.7 and 3.7 parsers.")
(file-name (git-file-name name version))
(sha256
(base32 "1knv353qhkl2imav3jfp6bgq47m8wkkqhq1dzmqg2sv8rsy7zgl7"))))
- (build-system python-build-system)
+ (build-system pyproject-build-system)
(arguments
- `(#:phases
- ,#~(modify-phases %standard-phases
- ;; Unfortunately, this doesn't seem to be enough to fix these two
- ;; tests, but we'll patch this anyway.
- (add-after 'unpack 'patch-shell-reference
- (lambda _
- (substitute* "tests/test_completion/test_completion.py"
- (("\"bash\"") (string-append "\"" (which "bash") "\""))
- (("\"/bin/bash\"")
- (string-append "\"" (which "bash") "\"")))))
- (replace 'build
- (lambda _
- (invoke "flit" "build")))
- (replace 'install
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (add-installed-pythonpath inputs outputs)
- (for-each
- (lambda (wheel)
- (format #true wheel)
- (invoke "python" "-m" "pip" "install"
- wheel (string-append "--prefix=" #$output)))
- (find-files "dist" "\\.whl$"))))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (setenv "HOME" "/tmp") ; some tests need it
-
- ;; This is for completion tests
- (with-output-to-file "/tmp/.bashrc"
- (lambda _ (display "# dummy")))
-
- (setenv "GUIX_PYTHONPATH"
- (string-append (getcwd) ":"
- (getenv "GUIX_PYTHONPATH")))
- (let ((disabled-tests (list "test_show_completion"
- "test_install_completion")))
- (invoke "python" "-m" "pytest" "tests/"
- "-k"
- (string-append "not "
- (string-join disabled-tests
- " and not "))))))))))
+ (list
+ #:test-flags
+ '(let ((disabled-tests (list "test_show_completion"
+ "test_install_completion")))
+ (list "-k" (string-append "not "
+ (string-join disabled-tests
+ " and not "))))
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Unfortunately, this doesn't seem to be enough to fix these two
+ ;; tests, but we'll patch this anyway.
+ (add-after 'unpack 'patch-shell-reference
+ (lambda _
+ (substitute* "tests/test_completion/test_completion.py"
+ (("\"bash\"") (string-append "\"" (which "bash") "\""))
+ (("\"/bin/bash\"")
+ (string-append "\"" (which "bash") "\"")))))
+ (add-before 'check 'pre-check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (setenv "HOME" "/tmp") ; some tests need it
+ ;; This is for completion tests
+ (with-output-to-file "/tmp/.bashrc"
+ (lambda _ (display "# dummy")))))))))
(propagated-inputs
(list python-click))
(native-inputs
(list python-coverage python-flit python-pytest python-rich
python-shellingham))
(home-page "https://github.com/tiangolo/typer")
- (synopsis
- "Typer builds CLI based on Python type hints")
+ (synopsis "Typer builds CLI based on Python type hints")
(description
- "Typer is a library for building CLI applications. It's based on
-Python 3.6+ type hints.")
+ "Typer is a library for building CLI applications. It's based on Python
+3.6+ type hints.")
;; MIT license
(license license:expat)))