gnu: python-black: Update to 22.3.0.
* gnu/packages/python-xyz.scm (python-black): Update to 22.3.0.
[phases]{relax-version-requirements}: Delete phase.
{use-absolute-file-names}: Streamline phase.
{disable-broken-tests, remove-entrypoint}: Delete phases.
This commit is contained in:
parent
bd1f8cdf52
commit
86be766874
1 changed files with 4 additions and 35 deletions
|
|
@ -5451,58 +5451,27 @@ matching of file paths.")
|
||||||
(define-public python-black
|
(define-public python-black
|
||||||
(package
|
(package
|
||||||
(name "python-black")
|
(name "python-black")
|
||||||
(version "21.12b0")
|
(version "22.3.0")
|
||||||
(source
|
(source
|
||||||
(origin
|
(origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (pypi-uri "black" version))
|
(uri (pypi-uri "black" version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1czjwr1bx9ax5l64xfi54sxb1ycdy4s9ciaqg592x7jn79lhzf3p"))))
|
"0yfahlqc7dsdp1js0cbv706apldnfnlbal9b53cww8n0hs40n0im"))))
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:phases
|
`(#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
;; XXX Remove this when updating this package:
|
|
||||||
;; https://github.com/psf/black/issues/2703#issuecomment-1004752142
|
|
||||||
(add-after 'unpack 'relax-version-requirements
|
|
||||||
(lambda _
|
|
||||||
(substitute* "setup.py"
|
|
||||||
(("tomli[^\"]*\",")
|
|
||||||
"tomli\","))))
|
|
||||||
(add-after 'patch-source-shebangs 'use-absolute-file-names
|
(add-after 'patch-source-shebangs 'use-absolute-file-names
|
||||||
(lambda* (#:key native-inputs inputs #:allow-other-keys)
|
(lambda* (#:key native-inputs inputs #:allow-other-keys)
|
||||||
(let* ((inpts (or native-inputs inputs))
|
(let* ((inpts (or native-inputs inputs))
|
||||||
(python3 (search-input-file inpts "/bin/python3"))
|
(python3 (search-input-file inpts "/bin/python3")))
|
||||||
(/bin/false (search-input-file inpts "/bin/false"))
|
|
||||||
(/bin/sleep (search-input-file inpts "/bin/sleep")))
|
|
||||||
(substitute* (find-files "tests" "\\.py$")
|
(substitute* (find-files "tests" "\\.py$")
|
||||||
(("#!/usr/bin/env python3(\\.[0-9]+)?" _ minor-version)
|
(("#!/usr/bin/env python3(\\.[0-9]+)?" _ minor-version)
|
||||||
(string-append "#!" python3 (if (string? minor-version)
|
(string-append "#!" python3 (if (string? minor-version)
|
||||||
minor-version
|
minor-version
|
||||||
""))))
|
"")))))))
|
||||||
(substitute* "tests/test_primer.py"
|
|
||||||
(("/bin/false") /bin/false)
|
|
||||||
(("/bin/sleep") /bin/sleep)))))
|
|
||||||
(add-after 'unpack 'disable-broken-tests
|
|
||||||
(lambda* (#:key outputs inputs #:allow-other-keys)
|
|
||||||
;; Make installed package available for running the tests
|
|
||||||
(setenv "PATH" (string-append (assoc-ref outputs "out") "/bin"
|
|
||||||
":" (getenv "PATH")))
|
|
||||||
|
|
||||||
;; The source formatting test fails because we patch various
|
|
||||||
;; files; just disable it.
|
|
||||||
(substitute* "tests/test_format.py"
|
|
||||||
(("def test_source_is_formatted" all)
|
|
||||||
(format #f "@pytest.mark.skip(\"Disabled by Guix.\")\n~a"
|
|
||||||
all)))))
|
|
||||||
;; Remove blackd, because it depends on python-aiohttp and
|
|
||||||
;; python-aiohttp-cors.
|
|
||||||
(add-after 'unpack 'remove-entrypoint
|
|
||||||
(lambda _
|
|
||||||
(substitute* "setup.py"
|
|
||||||
(("\\s*\"blackd=blackd:patched_main \\[d\\]\",\n") "")
|
|
||||||
(("\"blackd\", ") ""))))
|
|
||||||
(replace 'check
|
(replace 'check
|
||||||
(lambda* (#:key tests? #:allow-other-keys)
|
(lambda* (#:key tests? #:allow-other-keys)
|
||||||
(when tests? (invoke "pytest" "-vv")))))))
|
(when tests? (invoke "pytest" "-vv")))))))
|
||||||
|
|
|
||||||
Reference in a new issue