Archived
1
0
Fork 0

gnu: python-typer: Introduce gexps.

* gnu/packages/python-xyz.scm (python-typer)[arguments]: Switch to gexps.
[synopsis, description]: Fix indentation.
This commit is contained in:
Mathieu Othacehe 2022-08-12 10:35:32 +02:00
parent 3ceb985e75
commit 1385ef76d7
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -21526,44 +21526,46 @@ based on the CPython 2.7 and 3.7 parsers.")
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases ,#~(modify-phases %standard-phases
;; Unfortunately, this doesn't seem to be enough to fix these two ;; Unfortunately, this doesn't seem to be enough to fix these two
;; tests, but we'll patch this anyway. ;; tests, but we'll patch this anyway.
(add-after 'unpack 'patch-shell-reference (add-after 'unpack 'patch-shell-reference
(lambda _ (lambda _
(substitute* "tests/test_completion/test_completion.py" (substitute* "tests/test_completion/test_completion.py"
(("\"bash\"") (string-append "\"" (which "bash") "\"")) (("\"bash\"") (string-append "\"" (which "bash") "\""))
(("\"/bin/bash\"") (string-append "\"" (which "bash") "\""))))) (("\"/bin/bash\"")
(replace 'build (string-append "\"" (which "bash") "\"")))))
(lambda _ (replace 'build
(invoke "flit" "build"))) (lambda _
(replace 'install (invoke "flit" "build")))
(lambda* (#:key inputs outputs #:allow-other-keys) (replace 'install
(add-installed-pythonpath inputs outputs) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (add-installed-pythonpath inputs outputs)
(for-each (lambda (wheel) (for-each
(format #true wheel) (lambda (wheel)
(invoke "python" "-m" "pip" "install" (format #true wheel)
wheel (string-append "--prefix=" out))) (invoke "python" "-m" "pip" "install"
(find-files "dist" "\\.whl$"))))) wheel (string-append "--prefix=" #$output)))
(replace 'check (find-files "dist" "\\.whl$"))))
(lambda* (#:key tests? #:allow-other-keys) (replace 'check
(when tests? (lambda* (#:key tests? #:allow-other-keys)
(setenv "HOME" "/tmp") ; some tests need it (when tests?
(setenv "HOME" "/tmp") ; some tests need it
;; This is for completion tests ;; This is for completion tests
(with-output-to-file "/tmp/.bashrc" (lambda _ (display "# dummy"))) (with-output-to-file "/tmp/.bashrc"
(lambda _ (display "# dummy")))
(setenv "GUIX_PYTHONPATH" (setenv "GUIX_PYTHONPATH"
(string-append (getcwd) ":" (string-append (getcwd) ":"
(getenv "GUIX_PYTHONPATH"))) (getenv "GUIX_PYTHONPATH")))
(let ((disabled-tests (list "test_show_completion" (let ((disabled-tests (list "test_show_completion"
"test_install_completion"))) "test_install_completion")))
(invoke "python" "-m" "pytest" "tests/" (invoke "python" "-m" "pytest" "tests/"
"-k" "-k"
(string-append "not " (string-append "not "
(string-join disabled-tests (string-join disabled-tests
" and not ")))))))))) " and not "))))))))))
(propagated-inputs (propagated-inputs
(list python-click)) (list python-click))
(native-inputs (native-inputs
@ -21571,9 +21573,9 @@ based on the CPython 2.7 and 3.7 parsers.")
python-shellingham)) python-shellingham))
(home-page "https://github.com/tiangolo/typer") (home-page "https://github.com/tiangolo/typer")
(synopsis (synopsis
"Typer builds CLI based on Python type hints") "Typer builds CLI based on Python type hints")
(description (description
"Typer is a library for building CLI applications. It's based on "Typer is a library for building CLI applications. It's based on
Python 3.6+ type hints.") Python 3.6+ type hints.")
;; MIT license ;; MIT license
(license license:expat))) (license license:expat)))