From c8928304cfa8d8802d97ba68a3220e68f7ad5d32 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 26 Aug 2018 23:58:26 -0400 Subject: [PATCH 3/9] gnu: Add python-black. * gnu/packages/python.scm (python-black): New variable. --- gnu/packages/python.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index fb7f4b35c..e0a990491 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2744,6 +2744,41 @@ which can produce feeds in RSS 2.0, RSS 0.91, and Atom formats.") (define-public python2-toml (package-with-python2 python-toml)) +(define-public python-black + (package + (name "python-black") + (version "18.6b4") + (source + (origin + (method url-fetch) + (uri (pypi-uri "black" version)) + (sha256 + (base32 + "0i4sfqgz6w15vd50kbhi7g7rifgqlf8yfr8y78rypd56q64qn592")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'patch-source-shebangs 'patch-extra-shebangs + (lambda _ + (let ((python3 (which "python3"))) + (substitute* '("tests/data/fmtonoff.py" + "tests/data/string_prefixes.py" + "tests/data/function.py") + (("#!/usr/bin/env python3(\\.[0-9]+)?" _ minor-version) + (string-append "#!" python3 (if (string? minor-version) + minor-version + "")))))))))) + (propagated-inputs + `(("python-click" ,python-click) + ("python-attrs" ,python-attrs) + ("python-appdirs" ,python-appdirs) + ("python-toml" ,python-toml))) + (home-page "https://github.com/ambv/black") + (synopsis "The uncompromising code formatter") + (description "Black is the uncompromising Python code formatter.") + (license license:expat))) + (define-public python-blinker (package (name "python-blinker") -- 2.18.0