diff options
Diffstat (limited to 'gnu/packages/python-xyz.scm')
-rw-r--r-- | gnu/packages/python-xyz.scm | 840 |
1 files changed, 345 insertions, 495 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 295d158bd3..abee3df5a2 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -53,7 +53,7 @@ ;;; Copyright © 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr> ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com> ;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org> -;;; Copyright © 2018, 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com> ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org> ;;; Copyright © 2015, 2018 Pjotr Prins <pjotr.guix@thebird.nl> @@ -218,6 +218,7 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix hg-download) + #:use-module (guix gexp) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) @@ -670,12 +671,7 @@ implementation for the Telegram Bot API.") `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - ;; Extend PYTHONPATH so the built package will be found. - (setenv "PYTHONPATH" - (string-append (getcwd) "/build/lib:" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-p" "no:logging") - #t))))) + (invoke "pytest" "-p" "no:logging")))))) (home-page "https://github.com/borntyping/python-colorlog") (synopsis "Log formatting with colors for python") (description "The @code{colorlog.ColoredFormatter} is a formatter for use @@ -1049,15 +1045,16 @@ by @code{binstar}, @code{binstar-build}, and @code{chalmers}.") (version "2.9.0") (source (origin - (method url-fetch) - (uri (pypi-uri "Babel" version)) - (sha256 - (base32 - "018yg7g2pa6vjixx1nx41cfispgfi0azzp0a1chlycbj8jsil0ys")))) + (method url-fetch) + (uri (pypi-uri "Babel" version)) + (sha256 + (base32 + "018yg7g2pa6vjixx1nx41cfispgfi0azzp0a1chlycbj8jsil0ys")))) (build-system python-build-system) (native-inputs `(("python-freezegun" ,python-freezegun) - ("python-pytest" ,python-pytest))) + ("python-pytest" ,python-pytest) + ("tzdata" ,tzdata-for-tests))) (propagated-inputs `(("python-pytz" ,python-pytz))) (arguments @@ -1065,7 +1062,7 @@ by @code{binstar}, @code{binstar-build}, and @code{chalmers}.") (replace 'check (lambda _ (invoke "pytest" "-vv")))))) - (home-page "http://babel.pocoo.org/") + (home-page "https://babel.pocoo.org/") (synopsis "Tools for internationalizing Python applications") (description @@ -1117,7 +1114,7 @@ and verifies that it matches the intended target hostname.") (build-system python-build-system) (native-inputs `(("python-coverage" ,python-coverage) - ("python-hypothesis" ,python-hypothesis-5.23) ; use_true_random=... from >=5.19.0 + ("python-hypothesis" ,python-hypothesis) ("python-pre-commit" ,python-pre-commit) ("python-py" ,python-py) ("python-pytest" ,python-pytest) @@ -1217,14 +1214,6 @@ Expressions are constructed from parsed strings or directly in Python.") (modify-phases %standard-phases (replace 'check (lambda _ - ;; The 'runexamples' script sets PYTHONPATH to CWD, then goes - ;; on to import numpy. Somehow this works on their CI system. - ;; Let's just manage PYTHONPATH here instead. - (substitute* "runexamples.sh" - (("export PYTHONPATH=.*") "")) - (setenv "PYTHONPATH" - (string-append (getcwd) ":" - (getenv "PYTHONPATH"))) (invoke "./runexamples.sh") (invoke "nosetests" "-v")))))) (home-page "https://github.com/fhs/python-hdf4") @@ -1797,9 +1786,6 @@ language. It aims to be fast.") `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (format #t "current working dir ~s~%" (getcwd)) - (setenv "PYTHONPATH" - (string-append ".:" (getenv "PYTHONPATH"))) ;; We must run the test suite module directly, as it ;; fails to define the 'tempdir' variable in scope for ;; the tests otherwise @@ -2324,14 +2310,14 @@ in the current session, Python, and the OS.") (define-public python-six (package (name "python-six") - (version "1.14.0") + (version "1.15.0") (source (origin (method url-fetch) (uri (pypi-uri "six" version)) (sha256 (base32 - "02lw67hprv57hyg3cfy02y3ixjk3nzwc0dx3c4ynlvkfwkfdnsr3")))) + "0n82108wxn5giff50hd9ykjhd3zl7cndabdasi6568yvbh1rqqrh")))) (build-system python-build-system) (arguments `(#:phases @@ -2469,16 +2455,18 @@ audio playback capability for Python 3 on OSX, Windows, and Linux.") (define-public python-simplejson (package (name "python-simplejson") - (version "3.17.0") + (version "3.17.2") (source (origin (method url-fetch) (uri (pypi-uri "simplejson" version)) (sha256 (base32 - "108yf3252fy4ndqab7h46raksxfhcn113bzy2yd8369vidrjnjrb")))) + "0hc8nqwdlll4a9cr1k9msn5kmb6kmbjirpgvhjh254nr4sgwgv3m")))) (build-system python-build-system) - (home-page "http://simplejson.readthedocs.org/en/latest/") + (native-inputs + `(("python-toml" ,python-toml))) + (home-page "https://simplejson.readthedocs.io/en/latest") (synopsis "Json library for Python") (description @@ -2501,14 +2489,14 @@ Python 3.3+.") (define-public python-pyicu (package (name "python-pyicu") - (version "2.4.3") + (version "2.7.4") (source (origin (method url-fetch) (uri (pypi-uri "PyICU" version)) (sha256 (base32 - "075bw66b3w0nw6mc5k32fwmrhyrmq3d7da3q2mw212qfmm0pgjn0")))) + "0mkz1673qxldxs4mrqg9882xgmz5fhpia17yrsd6z8dfw8156rf0")))) (build-system python-build-system) (inputs `(("icu4c" ,icu4c))) @@ -3010,14 +2998,14 @@ server.") (define-public python-py (package (name "python-py") - (version "1.8.1") + (version "1.10.0") (source (origin (method url-fetch) (uri (pypi-uri "py" version)) (sha256 (base32 - "1ajjazg3913n0sp3vjyva9c2qh5anx8ziryng935f89604a0h9sy")))) + "1lqvkqk3b440g9z82gqbzlzas84wrm6ir8kplzhzavmn2pd1pf11")))) (build-system python-build-system) (arguments ;; FIXME: "ImportError: 'test' module incorrectly imported from @@ -3034,18 +3022,6 @@ server.") code introspection, and logging.") (license license:expat))) -(define-public python-py-next - (package - (inherit python-py) - (version "1.9.0") - (source - (origin - (method url-fetch) - (uri (pypi-uri "py" version)) - (sha256 - (base32 - "0hpk0gzd4v1pcnq7zinwg5n219czi23qghcswykqskkbwly8i9lw")))))) - (define-public python2-py (package-with-python2 python-py)) @@ -3240,11 +3216,9 @@ interfaces.") "cross-libc" "libc")))) (substitute* "src/click/_unicodefun.py" (("'locale'") - (string-append "'" glibc "/bin/locale'")))) - #t)) + (string-append "'" glibc "/bin/locale'")))))) (replace 'check (lambda _ - (setenv "PYTHONPATH" (string-append "./src:" (getenv "PYTHONPATH"))) (invoke "python" "-m" "pytest")))))) (native-inputs `(("python-pytest" ,python-pytest))) @@ -3360,8 +3334,6 @@ compare, diff, and patch JSON and JSON-like structures in Python.") (modify-phases %standard-phases (replace 'check (lambda* (#:key inputs outputs #:allow-other-keys) - (add-installed-pythonpath inputs outputs) - (setenv "PYTHONPATH" (string-append ".:" (getenv "PYTHONPATH"))) (invoke "trial" "jsonschema")))))) (native-inputs `(("python-setuptools_scm" ,python-setuptools-scm) @@ -3512,9 +3484,6 @@ somewhat intelligible.") '(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" - (string-append "./build/lib:" - (getenv "PYTHONPATH"))) (invoke "pytest" "-vv")))))) (native-inputs `(("python-pytest" ,python-pytest))) @@ -3610,13 +3579,13 @@ JavaScript-like message boxes. Types of dialog boxes include: (package (name "python-pympler") (home-page "https://pythonhosted.org/Pympler/") - (version "0.8") + (version "0.9") (source (origin (method url-fetch) (uri (pypi-uri "Pympler" version)) (sha256 (base32 - "08mrpnb6cv2nvfncvr8a9a8bpwhnasa924anapnjvnaw5jcd4k7p")))) + "0ivfw2k86nbw9ck9swidl4422w7bhjldxwj90a4sy5r1cbgygjzj")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases @@ -3645,14 +3614,14 @@ visualisation and class tracker statistics.") (define-public python-itsdangerous (package (name "python-itsdangerous") - (version "1.1.0") + (version "2.0.1") (source (origin (method url-fetch) (uri (pypi-uri "itsdangerous" version)) (sha256 (base32 - "068zpbksq5q2z4dckh2k1zbcq43ay74ylqn77rni797j0wyh66rj")))) + "1w6gfb2zhbcmrfj6digwzw1z68w6zg1q87rm6la2m412zil4swly")))) (build-system python-build-system) (home-page "https://palletsprojects.com/p/itsdangerous/") (synopsis "Python library for passing data to/from untrusted environments") @@ -3677,7 +3646,8 @@ environments and back.") "0pm440pmpvgv5rbbnm8hk4qga5a292kvlm1bh3x2nwr8pb5p8xv0")))) (build-system python-build-system) (inputs - `(("libyaml" ,libyaml))) + `(("libyaml" ,libyaml) + ("python-cython" ,python-cython))) (home-page "https://pyyaml.org") (synopsis "YAML parser and emitter for Python") (description @@ -3717,64 +3687,79 @@ e.g. filters, callbacks and errbacks can all be promises.") (define-public python-virtualenv (package (name "python-virtualenv") - (version "20.2.1") + (version "20.3.1") (source (origin (method url-fetch) (uri (pypi-uri "virtualenv" version)) (sha256 (base32 - "1rd6wmymsgv0cdsn50jwybcvbbslzym3mzffcjbl42l8br9cgap0")))) + "1nbhnpzswcf3lmzn5xabmfdd7ki8r2w2i37y6wml54di6qi1l48c")))) (build-system python-build-system) (native-inputs `(("python-mock" ,python-mock) ("python-pytest" ,python-pytest) - ;; NOTE: guix lint remarks that "python-setuptools should probably not - ;; be an input at all". However, removing the input makes the build error: - ;; File "setup.py", line 4, in <module> - ;; raise RuntimeError("setuptools >= 41 required to build") - ("python-setuptools" ,python-setuptools) ("python-setuptools-scm" ,python-setuptools-scm))) (propagated-inputs `(("python-appdirs" ,python-appdirs) - ("python-distlib" ,python-distlib/next) + ("python-distlib" ,python-distlib) ("python-filelock" ,python-filelock) - ("python-six" ,python-six) - ("python-importlib-metadata" ,python-importlib-metadata))) + ("python-six" ,python-six))) (home-page "https://virtualenv.pypa.io/") (synopsis "Virtual Python environment builder") (description "Virtualenv is a tool to create isolated Python environments.") (license license:expat))) +(define-public python2-virtualenv + (let ((base (package-with-python2 (strip-python2-variant python-virtualenv)))) + (package + (inherit base) + (arguments + `(#:python ,python-2 + #:phases + (modify-phases %standard-phases + (add-after 'set-paths 'adjust-PYTHONPATH + (lambda* (#:key inputs #:allow-other-keys) + (let* ((python (assoc-ref inputs "python")) + (python-sitedir (string-append python "/lib/python2.7" + "/site-packages"))) + ;; XXX: 'python2' always comes first on PYTHONPATH + ;; and shadows the 'setuptools' input. Move python2 + ;; last: this should be fixed in python-build-system + ;; in a future rebuild cycle. + (setenv "PYTHONPATH" + (string-append (string-join (delete python-sitedir + (string-split + (getenv "PYTHONPATH") + #\:)) + ":") + ":" python-sitedir)) + (format #t "environment variable `PYTHONPATH' changed to `~a'~%" + (getenv "PYTHONPATH")) + #t)))))) + (propagated-inputs + `(("python-contextlib2" ,python2-contextlib2) + ,@(package-propagated-inputs base)))))) + (define-public python-markupsafe (package (name "python-markupsafe") - (version "1.1.1") + (version "2.0.1") (source (origin (method url-fetch) (uri (pypi-uri "MarkupSafe" version)) (sha256 (base32 - "0sqipg4fk7xbixqd8kq6rlkxj664d157bdwbh93farcphf92x1r9")))) + "02k2ynmqvvd0z0gakkf8s4idyb606r7zgga41jrkhqmigy06fk2r")))) (build-system python-build-system) (arguments - `(#:modules ((ice-9 ftw) - (srfi srfi-1) - (srfi srfi-26) - (guix build utils) - (guix build python-build-system)) - #:phases (modify-phases %standard-phases + `(#:phases (modify-phases %standard-phases (replace 'check - (lambda _ - (let ((cwd (getcwd)) - (libdir (find (cut string-prefix? "lib." <>) - (scandir "build")))) - (setenv "PYTHONPATH" - (string-append cwd "/build/" libdir ":" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-vv"))))))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv"))))))) (native-inputs `(("python-pytest" ,python-pytest))) (home-page "https://github.com/mitsuhiko/markupsafe") @@ -3790,27 +3775,22 @@ for Python.") (define-public python-jinja2 (package (name "python-jinja2") - (version "2.11.2") + (version "3.0.1") (source (origin (method url-fetch) (uri (pypi-uri "Jinja2" version)) (sha256 (base32 - "1c1v3djnr0ymp5xpy1h3h60abcaqxdlm4wsqmls9rxby88av5al9")))) + "197ms1wimxql650245v63wkv04n8bicj549wfhp51bx68x5lhgvh")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? - (begin - (setenv "PYTHONPATH" - (string-append "./build/lib:" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-vv")) - (format #t "test suite not run~%")) - #t))))) + (invoke "pytest" "-vv") + (format #t "test suite not run~%"))))))) (native-inputs `(("python-pytest" ,python-pytest))) (propagated-inputs @@ -4109,15 +4089,14 @@ text styles of documentation.") (define-public python-pygments (package (name "python-pygments") - (version "2.7.3") + (version "2.8.1") (source (origin (method url-fetch) (uri (pypi-uri "Pygments" version)) (sha256 (base32 - "05mps9r966r3dpqw6zrs1nlwjdf5y4960hl9m7abwb3qyfnarwyc")))) - (replacement python-pygments/fixed) + "153zyxigm879sk2n71lfv03y2pgxb7dl0dlsbwkz9aydxnkf2mi6")))) (build-system python-build-system) (arguments ;; FIXME: Tests require sphinx, which depends on this. @@ -4129,18 +4108,6 @@ text styles of documentation.") (license license:bsd-2) (properties `((python2-variant . ,(delay python2-pygments)))))) -(define python-pygments/fixed - (package - (inherit python-pygments) - (version "2.7.4") - (source - (origin - (method url-fetch) - (uri (pypi-uri "Pygments" version)) - (sha256 - (base32 - "0dy35ry5qa8dpklk4fkj9kfpw2qb4mh5ha9866kw30wf96dx0jfz")))))) - ;; Pygments 2.6 and later does not support Python 2. (define-public python2-pygments (let ((base (package-with-python2 (strip-python2-variant python-pygments)))) @@ -4347,8 +4314,7 @@ ecosystem, but can naturally be used also by other projects.") ;; ;; OverflowError: mktime argument out of range (setenv "TZDIR" - (string-append (assoc-ref inputs "tzdata") - "/share/zoneinfo")) + (search-input-directory inputs "share/zoneinfo")) (setenv "TZ" "Europe/Paris") (invoke "python" "utest/run.py")))))) @@ -4821,7 +4787,14 @@ matching of file paths.") (substitute* "tests/test_black.py" (("( *)def test_python38" match indent) (string-append indent "@unittest.skip(\"guix\")\n" match))) - #t))))) + #t)) + ;; 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\", ") ""))))))) (propagated-inputs `(("python-click" ,python-click) ("python-attrs" ,python-attrs) @@ -5311,11 +5284,11 @@ color scales, and color space conversion easy. It has support for: ("pkg-config" ,pkg-config) ("python-sphinx" ,python-sphinx) ("python-numpydoc" ,python-numpydoc) - ("texlive" ,(texlive-union (list texlive-fonts-cm-super + ("texlive" ,(texlive-updmap.cfg (list texlive-fonts-cm-super texlive-fonts-ec texlive-generic-ifxetex texlive-generic-pdftex - texlive-amsfonts/patched + texlive-amsfonts texlive-latex-capt-of texlive-latex-cmap texlive-latex-environ @@ -5377,7 +5350,7 @@ color scales, and color space conversion easy. It has support for: (sphinx-theme-checkout (assoc-ref inputs scipy-sphinx-theme)) (pyver ,(string-append "PYVER="))) - ;; FIXME: this is needed to for texlive-union to generate + ;; FIXME: this is needed to for texlive-updmap.cfg to generate ;; fonts, which are not found. (setenv "HOME" "/tmp") @@ -5848,7 +5821,7 @@ toolkits.") ("python-ipykernel" ,python-ipykernel) ("python-mock" ,python-mock) ("graphviz" ,graphviz) - ("texlive" ,(texlive-union (list texlive-amsfonts/patched + ("texlive" ,(texlive-updmap.cfg (list texlive-amsfonts texlive-latex-amsmath texlive-latex-enumitem texlive-latex-expdlist @@ -5874,9 +5847,7 @@ toolkits.") (replace 'build (lambda _ (chdir "doc") - (setenv "PYTHONPATH" - (string-append (getenv "PYTHONPATH") - ":" (getcwd) "/../examples/units")) + (setenv "PYTHONPATH" "../examples/units") (substitute* "conf.py" ;; Don't use git. (("^SHA = check_output.*") @@ -5911,8 +5882,7 @@ toolkits.") "./matplotlib-figures") (invoke "makeinfo" "--no-split" "-o" "matplotlib.info" "matplotlib.texi")) - (install-file "build/texinfo/matplotlib.info" info)) - #t))))) + (install-file "build/texinfo/matplotlib.info" info))))))) (home-page (package-home-page python-matplotlib)) (synopsis "Documentation for the python-matplotlib package") (description (package-description python-matplotlib)) @@ -6146,24 +6116,12 @@ Python code against some of the style conventions in "07ikq2c72kd263hpldw55y0px2l3g34hjk66ml9lryh1jv287qmf")))) (build-system python-build-system) (arguments - '(#:modules ((ice-9 ftw) - (srfi srfi-1) - (srfi srfi-26) - (guix build utils) - (guix build python-build-system)) - #:phases (modify-phases %standard-phases + '(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? - (begin - (let ((libdir (find (cut string-prefix? "lib." <>) - (scandir "build")))) - (setenv "PYTHONPATH" - (string-append "./build/" libdir ":" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-vv"))) - (format #t "test suite not run~%")) - #t))))) + (invoke "pytest" "-vv") + (format #t "test suite not run~%"))))))) (native-inputs `(("python-pytest" ,python-pytest) ("python-pytest-cov" ,python-pytest-cov))) @@ -6242,14 +6200,14 @@ by pycodestyle.") (define-public python-distlib (package (name "python-distlib") - (version "0.3.0") + (version "0.3.1") (source (origin (method url-fetch) (uri (pypi-uri "distlib" version ".zip")) (sha256 (base32 - "08fyi2r246733vharl2yckw20rilci28r91mzrnnvcr638inw5if")))) + "1wdzv7fsjhrkhh1wfkarlhcwa8m00mgcpdsvknmf2qy8f9l13xpd")))) (build-system python-build-system) (arguments `(#:phases @@ -6273,19 +6231,6 @@ relate to packaging and distribution of Python software. It is intended to be used as the basis for third-party packaging tools.") (license license:psfl))) -;; TODO: Merge with 'python-distlib' on the next rebuild cycle. -(define-public python-distlib/next - (package - (inherit python-distlib) - (version "0.3.1") - (source - (origin - (method url-fetch) - (uri (pypi-uri "distlib" version ".zip")) - (sha256 - (base32 - "1wdzv7fsjhrkhh1wfkarlhcwa8m00mgcpdsvknmf2qy8f9l13xpd")))))) - (define-public python-distutils-extra (package (name "python-distutils-extra") @@ -6380,7 +6325,7 @@ the OleFileIO module from PIL, the Python Image Library.") (native-inputs `(("pybind11" ,pybind11) ("python-setuptools" ,python-setuptools) - ("python-setuptools-scm" ,python-setuptools-scm/next) + ("python-setuptools-scm" ,python-setuptools-scm) ("python-setuptools-scm-git-archive" ,python-setuptools-scm-git-archive) ("python-toml" ,python-toml) ("python-wheel" ,python-wheel))) @@ -6972,22 +6917,16 @@ support for Python 3 and PyPy. It is based on cffi.") (("filenames = \\(library_filename,\\) \\+ filenames") "pass") (("libcairo.so.2") - (string-append (assoc-ref inputs "cairo") - "/lib/libcairo.so.2"))) + (search-input-file inputs "/lib/libcairo.so.2"))) (substitute* "cairocffi/pixbuf.py" (("libgdk_pixbuf-2.0.so.0") - (string-append (assoc-ref inputs "gdk-pixbuf") - "/lib/libgdk_pixbuf-2.0.so.0")) + (search-input-file inputs "/lib/libgdk_pixbuf-2.0.so.0")) (("libgobject-2.0.so.0") - (string-append (assoc-ref inputs "glib") - "/lib/libgobject-2.0.so.0")) + (search-input-file inputs "/lib/libgobject-2.0.so.0")) (("libglib-2.0.so.0") - (string-append (assoc-ref inputs "glib") - "/lib/libglib-2.0.so.0")) + (search-input-file inputs "/lib/libglib-2.0.so.0")) (("libgdk-3.so.0") - (string-append (assoc-ref inputs "gtk+") - "/lib/libgdk-3.so.0"))) - #t)) + (search-input-file inputs "/lib/libgdk-3.so.0"))))) (add-after 'unpack 'disable-linters ;; Their check fails; none of our business. (lambda _ @@ -7026,13 +6965,13 @@ PNG, PostScript, PDF, and SVG file output.") (define-public python-decorator (package (name "python-decorator") - (version "4.3.0") + (version "4.4.2") (source (origin (method url-fetch) (uri (pypi-uri "decorator" version)) (sha256 - (base32 "0308djallnh00v112y5b7nadl657ysmkp6vc8xn51d6yzc9zm7n3")))) + (base32 "1rxzhk5zwiggk45hl53zydvy70lk654kg0nc1p54090p402jz9p3")))) (build-system python-build-system) (home-page "https://pypi.org/project/decorator/") (synopsis "Python module to simplify usage of decorators") @@ -7309,13 +7248,13 @@ child application and control it as if a human were typing commands.") (define-public python-setuptools-scm (package (name "python-setuptools-scm") - (version "3.4.3") + (version "5.0.1") (source (origin (method url-fetch) (uri (pypi-uri "setuptools_scm" version)) (sha256 (base32 - "083k93wi7mrmp1cn28hcbnr6sivbgls0y7zz2m5qzn1wg04a3f16")))) + "0ahlrxxkx2xhmxskx57gc96w3bdndflxx30304ihvm7ds136nny8")))) (build-system python-build-system) (home-page "https://github.com/pypa/setuptools_scm/") (synopsis "Manage Python package versions in SCM metadata") @@ -7325,18 +7264,6 @@ child application and control it as if a human were typing commands.") them as the version argument or in a SCM managed file.") (license license:expat))) -;; TODO: Merge with 'python-setuptools-scm' on the next rebuild cycle. -(define-public python-setuptools-scm/next - (package - (inherit python-setuptools-scm) - (version "5.0.1") - (source - (origin - (method url-fetch) - (uri (pypi-uri "setuptools_scm" version)) - (sha256 - (base32 "0ahlrxxkx2xhmxskx57gc96w3bdndflxx30304ihvm7ds136nny8")))))) - (define-public python2-setuptools-scm (package-with-python2 python-setuptools-scm)) @@ -8189,10 +8116,10 @@ computing.") `(("python-sphinx" ,python-sphinx) ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme) ;; FIXME: It's possible that a smaller union would work just as well. - ("texlive" ,(texlive-union (list texlive-amsfonts/patched + ("texlive" ,(texlive-updmap.cfg (list texlive-amsfonts texlive-fonts-ec texlive-generic-ifxetex - texlive-generic-pdftex + texlive-pdftex texlive-latex-capt-of texlive-latex-cmap texlive-latex-environ @@ -8525,10 +8452,15 @@ converts incoming documents to Unicode and outgoing documents to UTF-8.") (base32 "1k70gpn2d3vgdyxbdy536dgm4kchcraxz6lmgsfg3324iy2789q5")))) (build-system python-build-system) - (arguments `(#:tests? #f)) - ;;XXX: 2 tests fail currently despite claming they were to be - ;;skipped. Also, beautifulsoup4 may depend on this in the future, so we - ;;don't want to create a circular dependency. + (arguments + ;;XXX: 2 tests fail currently despite claming they were to be + ;;skipped. Also, beautifulsoup4 may depend on this in the future, so we + ;;don't want to create a circular dependency. + (list #:tests? #f + #:phases + #~(modify-phases %standard-phases + ;; Circular dependency with python-beautifulsoup4. + (delete 'sanity-check)))) (home-page "https://github.com/facelessuser/soupsieve") (synopsis "CSS selector library") (description @@ -9127,8 +9059,6 @@ Python 2 and Python 3.") (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" (string-append "./build/lib:" - (getenv "PYTHONPATH"))) (invoke "py.test" "-v")))))) (native-inputs `(("python2-pytest" ,python2-pytest))) @@ -9283,11 +9213,10 @@ PEP 8.") (method url-fetch) (uri (pypi-uri "pyflakes" version)) (sha256 - (base32 - "1ny10364ciqh4ripasj4zzv4145l21l3s85m3qlrvfq5pk58xg7m")))) + (base32 + "1ny10364ciqh4ripasj4zzv4145l21l3s85m3qlrvfq5pk58xg7m")))) (build-system python-build-system) - (home-page - "https://github.com/pyflakes/pyflakes") + (home-page "https://github.com/PyCQA/pyflakes") (synopsis "Passive checker of Python programs") (description "Pyflakes statically checks Python source code for common errors.") @@ -9312,21 +9241,21 @@ PEP 8.") (name "python-mccabe") (version "0.6.1") (source - (origin - (method url-fetch) - (uri (pypi-uri "mccabe" version)) - (sha256 - (base32 - "07w3p1qm44hgxf3vvwz84kswpsx6s7kvaibzrsx5dzm0hli1i3fx")))) + (origin + (method url-fetch) + (uri (pypi-uri "mccabe" version)) + (sha256 + (base32 + "07w3p1qm44hgxf3vvwz84kswpsx6s7kvaibzrsx5dzm0hli1i3fx")))) (build-system python-build-system) (native-inputs - `(("python-pytest" ,python-pytest-bootstrap) - ("python-pytest-runner" ,python-pytest-runner))) - (home-page "https://github.com/flintwork/mccabe") + `(("python-toml", python-toml) + ("python-pytest" ,python-pytest-bootstrap) + ("python-pytest-runner" ,python-pytest-runner))) + (home-page "https://github.com/PyCQA/mccabe") (synopsis "McCabe checker, plugin for flake8") - (description - "This package provides a Flake8 plug-in to compute the McCabe cyclomatic -complexity of Python source code.") + (description "This package provides a Flake8 plug-in to compute the McCabe +cyclomatic complexity of Python source code.") (license license:expat))) (define-public python2-mccabe @@ -9503,14 +9432,11 @@ unnecessary plus operators for explicit string literal concatenation.") (substitute* "setup.cfg" (("\\[pytest\\]") "[tool:pytest]")) - - (setenv "PYTHONPATH" - (string-append (getcwd) "/build/lib:" - (getenv "PYTHONPATH"))) (invoke "py.test" "-v")))))) + (propagated-inputs + `(("python-flake8" ,python-flake8))) (native-inputs - `(("python-flake8" ,python-flake8) - ("python-mock" ,python-mock) + `(("python-mock" ,python-mock) ("python-pep8" ,python-pep8) ("python-pycodestyle" ,python-pycodestyle) ("python-pytest" ,python-pytest))) @@ -9549,14 +9475,14 @@ files.") (define-public python-flake8-pyi (package (name "python-flake8-pyi") - (version "20.5.0") + (version "20.10.0") (source (origin (method url-fetch) (uri (pypi-uri "flake8-pyi" version)) (sha256 (base32 - "1zpq4s9kp8w95pccmhhyyx1ff2zhnidcf1zb3xs46lzcx9plvnzk")))) + "0b27n2pmrxcc7nva4wp2i7mrag0fnq0firvhg1ljq593a45b5qyf")))) (build-system python-build-system) (propagated-inputs `(("python-attrs" ,python-attrs) @@ -10003,14 +9929,7 @@ third-party code.") (modify-phases %standard-phases (replace 'check (lambda _ - (let ((cwd (getcwd))) - (setenv "PYTHONPATH" - (string-append cwd "/build/" - (find (cut string-prefix? "lib" <>) - (scandir (string-append cwd "/build"))) - ":" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-v" "test"))))))) + (invoke "pytest" "-v" "test")))))) (native-inputs `(("python-pytest" ,python-pytest))) (synopsis "MessagePack (de)serializer") @@ -10673,6 +10592,7 @@ is binding LibSass.") (build-system python-build-system) (arguments `(#:tests? #f)) ;circular dependency with python-aiohttp + (propagated-inputs `(("python-idna" ,python-idna))) (home-page "https://github.com/aio-libs/idna-ssl") (synopsis "Patch @code{ssl.match_hostname} for Unicode(idna) domains support") (description "Patch @code{ssl.match_hostname} for Unicode(idna) @@ -10989,7 +10909,7 @@ JSON Reference and JSON Pointer.") ("python-json-spec" ,python-json-spec) ("python-jsonschema" ,python-jsonschema) ("python-pylint" ,python-pylint) - ("python-pytest" ,python-pytest-6) + ("python-pytest" ,python-pytest) ("python-pytest-benchmark" ,python-pytest-benchmark) ("python-pytest-cache" ,python-pytest-cache) @@ -11255,8 +11175,8 @@ time.") ("python-pytest" ,python-pytest) ("python-pytest-cov" ,python-pytest-cov) ("python-pytest-dependency" ,python-pytest-dependency) - ("texlive" ,(texlive-union (list texlive-adjustbox - texlive-amsfonts/patched + ("texlive" ,(texlive-updmap.cfg (list texlive-adjustbox + texlive-amsfonts texlive-booktabs texlive-caption texlive-eurosym @@ -11625,7 +11545,8 @@ automatically detect a wide range of file encodings.") (file-name (git-file-name name version)) (sha256 (base32 - "0aad9gbswnnhssin2q0m5lmpm0ahyf80ahs2zjigbn5y7fvljnd0")))) + "0aad9gbswnnhssin2q0m5lmpm0ahyf80ahs2zjigbn5y7fvljnd0")) + (patches (search-patches "python-docopt-pytest6-compat.patch")))) (build-system python-build-system) (native-inputs `(("python-pytest" ,python-pytest))) @@ -11633,7 +11554,9 @@ automatically detect a wide range of file encodings.") `(#:phases (modify-phases %standard-phases (replace 'check - (lambda _ (invoke "py.test")))))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "py.test"))))))) (home-page "http://docopt.org") (synopsis "Command-line interface description language for Python") (description "This library allows the user to define a command-line @@ -11847,14 +11770,15 @@ tables.") (define-public python-atomicwrites (package (name "python-atomicwrites") - (version "1.3.0") + (version "1.4.0") (source (origin (method url-fetch) (uri (pypi-uri "atomicwrites" version)) (sha256 (base32 - "19ngcscdf3jsqmpcxn6zl5b6anmsajb6izp1smcd1n02midl9abm")))) + "0yla2svfhfqrcj8qbyqzx7wi4jy0dwcxvlkg0k3zjd54s5m3jw5f")))) (build-system python-build-system) + (arguments `(#:tests? #f)) ;avoid circular dependency with pytest (synopsis "Atomic file writes in Python") (description "Library for atomic file writes using platform dependent tools for atomic file system operations.") @@ -12428,8 +12352,6 @@ text.") #t)) (replace 'check (lambda _ - (setenv "PYTHONPATH" (string-append "./build/lib:" - (getenv "PYTHONPATH"))) (invoke "pytest" "-vv" "-m" "not network" ;; These tests require Docker. "-k" "not test_terminate_job \ @@ -13813,31 +13735,19 @@ syntax highlighting, markdown and more to the terminal.") (define-public python-magic (package (name "python-magic") - (version "0.4.15") + (version "0.4.22") + (home-page "https://github.com/ahupp/python-magic") (source (origin - (method url-fetch) - (uri (pypi-uri "python-magic" version)) + (method git-fetch) + (uri (git-reference (url home-page) (commit version))) + (file-name (git-file-name name version)) (sha256 (base32 - "1mgwig9pnzgkf86q9ji9pnc99bngms15lfszq5rgqb9db07mqxpk")) - (file-name (string-append name "-" version "-checkout")))) + "0zbdjr5shijs0jayz7gycpx0kn6v2bh83dpanyajk2vmy47jvbd6")))) (build-system python-build-system) (arguments - ;; The tests are unreliable, so don't run them. The tests fail - ;; under Python3 because they were written for Python2 and - ;; contain import statements that do not work in Python3. One of - ;; the tests fails under Python2 because its assertions are - ;; overly stringent; it relies on comparing output strings which - ;; are brittle and can change depending on the version of - ;; libmagic being used and the system on which the test is - ;; running. In my case, under GuixSD 0.10.0, only one test - ;; failed, and it seems to have failed only because the version - ;; of libmagic that is packaged in Guix outputs a slightly - ;; different (but not wrong) string than the one that the test - ;; expected. - '(#:tests? #f - #:phases (modify-phases %standard-phases + '(#:phases (modify-phases %standard-phases ;; Replace a specific method call with a hard-coded ;; path to the necessary libmagic.so file in the ;; store. If we don't do this, then the method call @@ -13847,24 +13757,22 @@ syntax highlighting, markdown and more to the terminal.") (add-before 'build 'hard-code-path-to-libmagic (lambda* (#:key inputs #:allow-other-keys) (let ((file (assoc-ref inputs "file"))) - (substitute* "magic.py" - (("ctypes.util.find_library\\('magic'\\)") - (string-append "'" file "/lib/libmagic.so'"))) - #t))) - (add-before 'install 'disable-egg-compression - (lambda _ - (let ((port (open-file "setup.cfg" "a"))) - (display "\n[easy_install]\nzip_ok = 0\n" - port) - (close-port port) - #t)))))) + (substitute* "magic/loader.py" + (("ctypes\\.util\\.find_library\\('magic'\\)") + (string-append "'" file "/lib/libmagic.so'")))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + ;; The test suite mandates this variable. + (setenv "LC_ALL" "en_US.UTF-8") + (if tests? + (invoke "python" "./test/test.py") + (format #t "test suite not run~%"))))))) + (native-inputs + `(("which" ,which))) (inputs ;; python-magic needs to be able to find libmagic.so. `(("file" ,file))) - (home-page - "https://github.com/ahupp/python-magic") - (synopsis - "File type identification using libmagic") + (synopsis "File type identification using libmagic") (description "This module uses ctypes to access the libmagic file type identification library. It makes use of the local magic database and @@ -14196,12 +14104,6 @@ module in Python 3.5 and later.") (modify-phases %standard-phases (replace 'check (lambda _ - ;; Upstream runs tests after installation and the package itself - ;; resides in a subdirectory. Extend PYTHONPATH so it will be - ;; found. - (setenv "PYTHONPATH" - (string-append (getcwd) "/build/lib:" - (getenv "PYTHONPATH"))) (invoke "py.test" "-vv" "tests" "README.rst")))))) (native-inputs `(("python-pytest" ,python-pytest) @@ -14364,13 +14266,6 @@ graphviz.") (string-join disabled-tests "\n"))))))) (replace 'check (lambda _ - ;; Make sure the build directory is on PYTHONPATH. - (setenv "PYTHONPATH" - (string-append - (getenv "PYTHONPATH") ":" - (getcwd) "/build/" - (car (scandir "build" (cut string-prefix? "lib." <>))))) - ;; Use the build daemons configured number of workers. (setenv "NWORKERS" (number->string (parallel-job-count))) @@ -14428,7 +14323,14 @@ format.") "17d3hnxv9qndagzz63mdpyk99xj63p9gq586vjn0rxk8cl197nym")))) (build-system python-build-system) (arguments - '(#:tests? #f)) ; FIXME: some tests fail + '(#:tests? #f ; FIXME: some tests fail + #:phases + (modify-phases %standard-phases + ;; Remove scripts, because they depend on [conch] + (add-after 'unpack 'remove-entrypoint + (lambda _ + (substitute* "src/twisted/python/_setup.py" + (("\".+ = twisted\\.conch\\.scripts\\..+\",") ""))))))) (propagated-inputs `(("python-zope-interface" ,python-zope-interface) ("python-pyhamcrest" ,python-pyhamcrest) @@ -14991,17 +14893,15 @@ some degree most natural languages too.") (delete-file "libcst/tests/test_pyre_integration.py") (delete-file "libcst/codemod/tests/test_codemod_cli.py") (delete-file "libcst/metadata/tests/test_full_repo_manager.py") - (delete-file "libcst/metadata/tests/test_type_inference_provider.py") - #t)) + (delete-file "libcst/metadata/tests/test_type_inference_provider.py"))) (add-before 'check 'generate-test-data (lambda _ - (setenv "PYTHONPATH" (string-append (getcwd) ":" (getenv "PYTHONPATH"))) (invoke "python" "-m" "libcst.codegen.generate" "visitors") (invoke "python" "-m" "libcst.codegen.generate" "return_types"))) (replace 'check - (lambda _ - (invoke "python" "-m" "unittest") - #t))))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python" "-m" "unittest"))))))) (native-inputs `(("python-black" ,python-black) ("python-isort" ,python-isort))) @@ -15026,6 +14926,14 @@ feels like an AST.") ;; libcst/_add_slots.py license:asl2.0)))) +(define-public python-libcst-minimal + (hidden-package + (package + (inherit python-libcst) + (name "python-libcst-minimal") + (arguments '(#:tests? #f)) + (native-inputs '())))) + (define-public python-typing-inspect (package (name "python-typing-inspect") @@ -15035,7 +14943,8 @@ feels like an AST.") (uri (pypi-uri "typing_inspect" version)) (sha256 (base32 - "1dzs9a1pr23dhbvmnvms2jv7l7jk26023g5ysf0zvnq8b791s6wg")))) + "1dzs9a1pr23dhbvmnvms2jv7l7jk26023g5ysf0zvnq8b791s6wg")) + (patches (search-patches "python-typing-inspect-fix.patch")))) (build-system python-build-system) (propagated-inputs `(("python-mypy-extensions" ,python-mypy-extensions) @@ -15284,7 +15193,8 @@ YAML-serialized data.") (build-system python-build-system) (native-inputs `(("python-pytest" ,python-pytest) - ("python-nose" ,python-nose))) + ("python-nose" ,python-nose) + ("python-toml" ,python-toml))) (propagated-inputs `(("python-simplejson" ,python-simplejson))) (home-page "https://github.com/sdispater/backpack") @@ -15596,9 +15506,7 @@ and/or Xon/Xoff. The port is accessed in RAW mode.") (add-after 'patch-generated-file-shebangs 'set-sdl-paths (lambda* (#:key inputs #:allow-other-keys) (setenv "KIVY_SDL2_PATH" - (string-append (assoc-ref inputs "sdl-union") - "/include/SDL2")) - #t))))) + (search-input-directory inputs "/include/SDL2"))))))) (native-inputs `(("pkg-config" ,pkg-config) ("python-cython" ,python-cython))) @@ -15674,14 +15582,9 @@ binary or text.") (arguments `(#:phases (modify-phases %standard-phases - (add-before 'check 'set-pythonpath + (add-before 'check 'set-home (lambda _ - (setenv "PYTHONPATH" - (string-append - (getcwd) "/src/" - ":" (getenv "PYTHONPATH"))) - (setenv "HOME" "") - #t))))) + (setenv "HOME" "")))))) (native-inputs `(("python-coverage" ,python-coverage) ("python-nose" ,python-nose))) @@ -15829,8 +15732,6 @@ discovery, monitoring and configuration.") (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" (string-append "./build/lib:" - (getenv "PYTHONPATH"))) (invoke "pytest" "-vv")))))) (build-system python-build-system) (native-inputs @@ -15861,27 +15762,14 @@ Python to manipulate OpenDocument 1.2 files.") "1ksqfai72dbcfbwx43pxl658j59mx2rvqypjy1fk0ax2qd6lccx6")))) (build-system python-build-system) (arguments - `(#:modules ((guix build utils) - (guix build python-build-system) - (srfi srfi-1) - (srfi srfi-26) - (ice-9 ftw)) - #:phases + `(#:phases (modify-phases %standard-phases (add-before 'check 'set-cachedir ;; Tests require write access to $HOME by default (lambda _ (setenv "PYTHON_EGG_CACHE" "/tmp") #t)) (replace 'check (lambda _ - (let ((cwd (getcwd))) - (setenv "PYTHONPATH" - (string-append - cwd "/build/" - (find (cut string-prefix? "lib" <>) - (scandir (string-append cwd "/build"))) - ":" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-v"))))))) + (invoke "pytest" "-v")))))) (native-inputs `(("python-hypothesis" ,python-hypothesis) ("python-pytest-cov" ,python-pytest-cov) @@ -16213,10 +16101,6 @@ is used by PostgreSQL and the OpenSSH Server for example.") (delete-file "tests/__init__.py"))) (replace 'check (lambda _ - ;; Extend PYTHONPATH so the built package will be found. - (setenv "PYTHONPATH" - (string-append (getcwd) "/build/lib:" - (getenv "PYTHONPATH"))) (invoke "py.test" "-vv" )))))) (native-inputs `(("python-pytest" ,python-pytest))) @@ -16245,16 +16129,6 @@ useful as a validator for JSON data.") (base32 "090vdksbz341f7ljvr0zswblw4lspa8qaiikzyjkf318arpxmil9")))) (build-system python-build-system) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'check 'set-pythonpath - (lambda _ - (setenv "PYTHONPATH" - (string-append - (getcwd) "/test/" - ":" (getenv "PYTHONPATH"))) - #t))))) (home-page "https://github.com/eliben/pyelftools") (synopsis @@ -16283,8 +16157,7 @@ Record Format (DWARF).") (modify-phases %standard-phases (add-after 'unpack 'patch (lambda* (#:key inputs #:allow-other-keys) - (let ((libev (string-append (assoc-ref inputs "libev") - "/lib/libev.so.4"))) + (let ((libev (search-input-file inputs "/lib/libev.so.4"))) (substitute* "setup.py" (("libev_dll_name = find_library\\(\\\"ev\\\"\\)") (string-append "libev_dll_name = \"" libev "\""))))))))) @@ -16518,43 +16391,25 @@ possible on all supported Python versions.") "0ar5dqjnqaw0c17mymd6xgd81jn9br9fblawr0x438v1571bkaya")))) (build-system python-build-system) (arguments - `(#:modules ((guix build utils) - (guix build python-build-system) - (ice-9 ftw) - (srfi srfi-1) - (srfi srfi-26)) - #:phases (modify-phases %standard-phases + `(#:phases (modify-phases %standard-phases (add-after 'unpack 'use-absolute-python (lambda _ (substitute* "Cheetah/CheetahWrapper.py" (("#!/usr/bin/env python") - (string-append "#!" (which "python")))) - #t)) + (string-append "#!" (which "python")))))) (add-after 'unpack 'fix-tests (lambda _ (substitute* "Cheetah/Tests/ImportHooks.py" (("os.path.dirname\\(__file__\\)") - (string-append "'" (getcwd) "/Cheetah/Tests'"))) - #t)) + (string-append "'" (getcwd) "/Cheetah/Tests'"))))) (replace 'check (lambda _ - (let ((cwd (getcwd))) - (setenv "PYTHONPATH" - (string-append - cwd "/build/" - (find (cut string-prefix? "lib" <>) - (scandir (string-append cwd "/build"))) - ":" (getenv "PYTHONPATH"))) - (setenv "PATH" - (string-append (getenv "PATH") - ":" cwd "/bin")) - (setenv "TMPDIR" "/tmp") - - (substitute* "Cheetah/Tests/Test.py" - (("unittest.TextTestRunner\\(\\)") - "unittest.TextTestRunner(verbosity=2)")) - - (invoke "python" "Cheetah/Tests/Test.py"))))))) + (setenv "TMPDIR" "/tmp") + (substitute* "Cheetah/Tests/Test.py" + (("unittest.TextTestRunner\\(\\)") + "unittest.TextTestRunner(verbosity=2)")) + + (invoke "python" "Cheetah/Tests/Test.py")))))) (propagated-inputs `(("python-markdown" ,python-markdown))) ;optional (home-page "https://cheetahtemplate.org/") @@ -16650,9 +16505,6 @@ protocols written in pure Python.") (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" - (string-append (getcwd) "/build/lib:" - (getenv "PYTHONPATH"))) (invoke "python" "test/test_pbkdf2.py")))))) (propagated-inputs `(("python-pycrypto" ,python-pycrypto))) ; optional @@ -16988,7 +16840,15 @@ instead of servers and network commands.") ;; python-twisted depends on python-automat. Twisted is optional, but the ;; tests fail if it is not available. Also see ;; <https://github.com/glyph/automat/issues/71>. - (arguments '(#:tests? #f)) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + ;; Remove script, because it depends on python-twisted. + (add-after 'unpack 'remove-entrypoint + (lambda _ + (substitute* "setup.py" + (("\"automat-visualize = automat._visualize:tool\"") ""))))))) (native-inputs `(("python-m2r" ,python-m2r) ("python-setuptools-scm" ,python-setuptools-scm) @@ -17065,33 +16925,17 @@ and bit flag values.") "1yzmwi5d197p0qhl7rl4xi9q1w8mk9i3zn6hrl22knbcrb1slspg")))) (build-system python-build-system) (arguments - `(#:modules ((guix build utils) - (guix build python-build-system) - (ice-9 ftw) - (srfi srfi-1) - (srfi srfi-26)) - #:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (let ((cwd (getcwd))) - (setenv "PYTHONPATH" - (string-append - cwd "/build/" - (find (cut string-prefix? "lib" <>) - (scandir (string-append cwd "/build"))) - ":" - (getenv "PYTHONPATH"))) - (invoke "python" "-m" "pytest")))))))) + `(#:phases (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest"))))))) (native-inputs `(("python-coverage" ,python-coverage) ("python-hypothesis" ,python-hypothesis) ("python-pympler" ,python-pympler) ("python-pytest" ,python-pytest) - ("python-six" ,python-six) - ("python-sphinx" ,python-sphinx) - ("python-zope-interface" ,python-zope-interface))) + ("python-six" ,python-six))) (home-page "https://github.com/python-attrs/attrs/") (synopsis "Attributes without boilerplate") (description "@code{attrs} is a Python package with class decorators that @@ -17106,13 +16950,6 @@ protocols.") (package (inherit python-attrs) (name "python-attrs-bootstrap") - (version "19.3.0") - (source (origin - (method url-fetch) - (uri (pypi-uri "attrs" version)) - (sha256 - (base32 - "0wky4h28n7xnr6xv69p9z6kv8bzn50d10c3drmd9ds8gawbcxdzp")))) (native-inputs `()) (arguments `(#:tests? #f)))) @@ -17220,28 +17057,22 @@ happens using the @code{logging} library.") (define-public python-astroid (package (name "python-astroid") - (version "2.4.2") + (version "2.6.6") (source (origin - (method url-fetch) - (uri (pypi-uri "astroid" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/PyCQA/astroid") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "00xp5gqxidxvgg1bwd91myqzdf2fpb9cjwbdl3p7gwqvlk17hh1g")) - (modules '((guix build utils))) - (snippet - '(begin - ;; Check to see if the version pinning has been removed. - (substitute* "astroid/__pkginfo__.py" - (("==1\\.4\\.\\*") ">=1.4.0")) - #t)))) + (base32 "1amzf996inwmh4r3mlpzmch60xs6lrg86vppfnwl1y0l8r0y7zxh")))) (build-system python-build-system) (propagated-inputs `(("python-lazy-object-proxy" ,python-lazy-object-proxy) - ("python-six" ,python-six) ("python-wrapt" ,python-wrapt))) (native-inputs - `(("python-dateutil" ,python-dateutil) - ("python-pytest" ,python-pytest) + `(("python-pytest" ,python-pytest) ("python-pytest-runner" ,python-pytest-runner))) (home-page "https://github.com/PyCQA/astroid") (synopsis "Common base representation of python source code for pylint and @@ -17317,23 +17148,77 @@ version, is suitable to be include as a dependency in other projects.") (define-public python-isort (package (name "python-isort") - (version "4.3.4") + (version "5.7.0") (source (origin (method git-fetch) (uri (git-reference - ;; Tests pass only from the Github sources - (url "https://github.com/timothycrosley/isort") - (commit version))) + ;; Tests pass only from the Github sources + (url "https://github.com/timothycrosley/isort") + (commit version))) (file-name (git-file-name name version)) + (modules '((guix build utils))) + (snippet '(for-each delete-file (find-files "." "\\.whl$"))) (sha256 (base32 - "1q0mlrpki5vjbgwxag5rghljjcfg7mvb0pbkwid80p0sqrxlm2p6")))) + "0phq4s911mjjdyr5h5siz93jnpkqb2qgphgcfk6axncgxr8i7vi1")))) (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; A foretaste of what our future python-build-system will need to + ;; do. + (replace 'build + (lambda _ + (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (whl (car (find-files "dist" "\\.whl$")))) + (invoke "pip" "--no-cache-dir" "--no-input" + "install" "--no-deps" "--prefix" out whl)))) + (add-after 'install 'install-example-plugins + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; Patch to use the core poetry API. + (substitute* '("example_isort_formatting_plugin/pyproject.toml" + "example_shared_isort_profile/pyproject.toml") + (("poetry>=0.12") + "poetry-core>=1.0.0") + (("poetry.masonry.api") + "poetry.core.masonry.api")) + ;; Build the example plugins. + (for-each (lambda (source-directory) + (invoke "python" "-m" "build" "--wheel" + "--no-isolation" "--outdir=dist" + source-directory)) + '("example_isort_formatting_plugin" + "example_shared_isort_profile")) + ;; Install them to temporary storage, for the test. + (setenv "HOME" (getcwd)) + (let ((example-whls (find-files "dist" "^example.*\\.whl$"))) + (apply invoke "pip" "--no-cache-dir" "--no-input" + "install" "--user" "--no-deps" example-whls))))) + (replace 'check + (lambda* (#:key tests? inputs outputs #:allow-other-keys) + (when tests? + (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) + (setenv "PATH" (string-append (getenv "PATH") ":" bin))) + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "-vv" "tests/unit/" + "--ignore=tests/unit/test_deprecated_finders.py"))))))) (native-inputs - `(("python-mock" ,python-mock) + `(("git" ,git-minimal) + ("python-black" ,python-black) + ("python-colorama" ,python-colorama) + ("python-hypothesmith" ,python-hypothesmith) + ("python-libcst" ,python-libcst-minimal) + ("python-poetry-core" ,python-poetry-core) + ("python-pylama" ,python-pylama) + ("python-pypa-build" ,python-pypa-build) + ("python-pytest-mock" ,python-pytest-mock) ("python-pytest" ,python-pytest))) - (home-page "https://github.com/timothycrosley/isort") + (home-page "https://github.com/PyCQA/isort") (synopsis "Python utility/library to sort python imports") (description "@code{python-isort} is a python utility/library to sort imports alphabetically, and automatically separated into sections. It @@ -17705,9 +17590,6 @@ of corner cases, factory_boy allows you to use objects customized for the current test, while only declaring the test-specific fields") (license license:expat))) -(define-public python2-factory-boy - (package-with-python2 python-factory-boy)) - (define-public python-translate-toolkit (package (name "python-translate-toolkit") @@ -17797,10 +17679,17 @@ information.") (package/inherit python-packaging (name "python-packaging-bootstrap") + (arguments + (substitute-keyword-arguments (package-arguments python-packaging) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'fix-dependencies + (lambda* (#:key tests? #:allow-other-keys) + (substitute* "setup.py" (("\"six\"") "")))))) + ((#:tests? _ #f) #f))) (native-inputs '()) (propagated-inputs - `(("python-pyparsing" ,python-pyparsing))) - (arguments '(#:tests? #f))))) + `(("python-pyparsing" ,python-pyparsing)))))) (define-public python2-packaging-bootstrap (hidden-package @@ -17809,7 +17698,8 @@ information.") (name "python2-packaging-bootstrap") (native-inputs '()) (propagated-inputs - `(("python-pyparsing" ,python2-pyparsing))) + `(("python-pyparsing" ,python2-pyparsing) + ("python-six" ,python2-six-bootstrap))) (arguments `(#:tests? #f ,@(package-arguments python2-packaging)))))) @@ -17855,6 +17745,13 @@ for more filetypes can be easily added by creating plugins for them.") (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'relax-requirements + (lambda _ + (substitute* "setup.py" + ((".*'future'.*") + "") + (("colorama==0.4.1") + "colorama>=0.4.1")))) (replace 'check (lambda _ (invoke "python" "radon/tests/run.py")))))) @@ -18088,23 +17985,11 @@ applying JSON Patches according to RFC 6902.") "17dvx15m3r49bmif5zlli8kzjd6bys6psixzbp14sd5367d9h8qi")))) (build-system python-build-system) (arguments - `(#:modules ((guix build utils) - (guix build python-build-system) - (ice-9 ftw) - (srfi srfi-1) - (srfi srfi-26)) - #:phases + `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (let ((cwd (getcwd))) - (setenv "PYTHONPATH" - (string-append cwd "/build/" - (find (cut string-prefix? "lib" <>) - (scandir (string-append cwd "/build"))) - ":" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-v"))))))) + (invoke "pytest" "-v")))))) (native-inputs `(("python-pytest" ,python-pytest))) (home-page "https://rfc3986.readthedocs.io/") @@ -18426,19 +18311,13 @@ complex datatypes to and from native Python datatypes.") (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases - (add-after 'unpack 'disable-prance-tests - (lambda _ - ;; Disable validation tests since they require the - ;; optional 'prance' library which is not yet in Guix. - (substitute* "tests/test_ext_marshmallow_openapi.py" - (("def test_openapi_tools_validate.*" all) - (string-append "@pytest.mark.xfail\n" all))))) (replace 'check (lambda _ - (setenv "PYTHONPATH" - (string-append "./build/lib:" - (getenv "PYTHONPATH"))) - (invoke "pytest" "-vv")))))) + (invoke "pytest" "-vv" + ;; Disable validation tests since they require + ;; the optional 'prance' library which is not + ;; yet in Guix. + "-k" "not openapi_tools_validate")))))) (propagated-inputs `(("python-pyyaml" ,python-pyyaml))) (native-inputs @@ -18473,9 +18352,6 @@ as Swagger.") (substitute* "Makefile" (("flake8 flasgger --ignore=F403") "flake8 flasgger --ignore=E731,F403")) - (setenv "PYTHONPATH" (string-append (getcwd) - ":" - (getenv "PYTHONPATH"))) (invoke "py.test")))))) (propagated-inputs `(("python-flask" ,python-flask) @@ -18862,25 +18738,26 @@ ignoring formatting changes.") (define-public python-tqdm (package (name "python-tqdm") - (version "4.43.0") + (version "4.60.0") (source (origin (method url-fetch) (uri (pypi-uri "tqdm" version)) (sha256 (base32 - "093v4c2x5hpigv47zvyxl8wh10y2yd2gvz3l9vchn0zsp8hv2pzk")))) + "1bjpy4mjg6ryp0ijvqi77vgs76l5hh3zrv3x4vmcwxrlbswvvppb")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'check - (lambda* (#:key inputs outputs #:allow-other-keys) - (add-installed-pythonpath inputs outputs) - ;; This invokation is taken from tox.ini. - (invoke "nosetests" "--ignore-files=\"test_perf.py\"" - "-d" "-v" "tqdm/")))))) + (lambda _ + (invoke "pytest" "-vv" "-k" "not perf")))))) (native-inputs - `(("python-nose" ,python-nose))) + `(("python-pytest" ,python-pytest) + ("python-pytest-asyncio" ,python-pytest-asyncio) + ("python-pytest-timeout" ,python-pytest-timeout) + ("python-setuptools-scm" ,python-setuptools-scm) + ("python-toml" ,python-toml))) (home-page "https://github.com/tqdm/tqdm") (synopsis "Fast, extensible progress meter") (description @@ -19004,7 +18881,8 @@ lines are read from a single file.") (native-inputs `(("python-pbr" ,python-pbr-minimal))) (propagated-inputs - `(("python-linecache2" ,python-linecache2))) + `(("python-linecache2" ,python-linecache2) + ("python-six" ,python-six))) (home-page "https://github.com/testing-cabal/traceback2") (synopsis "Backports of the traceback module") @@ -19944,7 +19822,7 @@ source bytes using the UTF-8 encoding and then rewrites Python 3.6 style (define-public python-typed-ast (package (name "python-typed-ast") - (version "1.4.0") + (version "1.4.2") (source (origin (method git-fetch) @@ -19952,28 +19830,15 @@ source bytes using the UTF-8 encoding and then rewrites Python 3.6 style (url "https://github.com/python/typed_ast") (commit version))) (sha256 - (base32 "0l0hz809f7i356kmqkvfsaswiidb98j9hs9rrjnfawzqcbffzgyb")) + (base32 "1wr6pkvvrq6rzjjw88pd5xy8fy06msam4hlxbkglvdmwh4c083l0")) (file-name (git-file-name name version)))) (build-system python-build-system) (arguments - `(#:modules ((guix build utils) - (guix build python-build-system) - (ice-9 ftw) - (srfi srfi-1) - (srfi srfi-26)) - #:phases + `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (let ((cwd (getcwd))) - (setenv "PYTHONPATH" - (string-append cwd "/build/" - (find (cut string-prefix? "lib" <>) - (scandir (string-append cwd "/build"))) - ":" - (getenv "PYTHONPATH")))) - (invoke "pytest") - #t))))) + (invoke "pytest")))))) (native-inputs `(("python-pytest" ,python-pytest))) (home-page "https://github.com/python/typed_ast") (synopsis "Fork of Python @code{ast} modules with type comment support") @@ -20679,8 +20544,7 @@ user-space file systems in Python.") (("pytest < 5") "pytest < 7")) ;; We don't care about a coverage report. (substitute* "test/requirements.txt" - (("coverage.*") "coverage\n")) - #t)) + (("coverage.*") "coverage\n")))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? @@ -20688,11 +20552,7 @@ user-space file systems in Python.") (delete-file "test/test_js_client.py") (delete-file "test/test_tsd_types.py") (delete-file "test/test_python_gen.py") - (setenv "PYTHONPATH" - (string-append (getcwd) ":" - (getenv "PYTHONPATH"))) - (invoke "pytest")) - #t))))) + (invoke "pytest"))))))) (propagated-inputs `(("python-ply" ,python-ply) ("python-six" ,python-six))) @@ -20855,9 +20715,12 @@ library to allow local file system access via @code{file://} URLs.") (arguments `(#:phases (modify-phases %standard-phases + ;; system-error "utime" "~A" ("No such file or directory") + (delete 'ensure-no-mtimes-pre-1980) (replace 'check - (lambda _ - (invoke "pytest" "-vv")))))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv"))))))) (native-inputs `(("python-coverage" ,python-coverage) ("python-pytest" ,python-pytest))) @@ -21504,13 +21367,6 @@ data.") (arguments '(#:phases (modify-phases %standard-phases - (add-before 'check 'do-not-override-PYTHONPATH - (lambda _ - ;; Append to PYTHONPATH instead of overriding it so - ;; that dependencies from Guix can be found. - (substitute* "tests/testutils.py" - (("env\\['PYTHONPATH'\\] = pythonpath") - "env['PYTHONPATH'] += os.pathsep + pythonpath")))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? @@ -22990,8 +22846,6 @@ essential tools are located.") (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" - (string-append (getcwd) ":" (getenv "PYTHONPATH"))) (invoke "python" "./tests/__main__.py")))))) (propagated-inputs `(("python-dill" ,python-dill) @@ -24531,8 +24385,7 @@ be necessary when using @code{cmd}.") (modify-phases %standard-phases (add-before 'build 'qualify-libtidy (lambda* (#:key inputs #:allow-other-keys) - (let ((libtidy (string-append (assoc-ref inputs "tidy") - "/lib/libtidy.so"))) + (let ((libtidy (search-input-file inputs "/lib/libtidy.so"))) (substitute* "tidylib/tidy.py" (("ctypes\\.util\\.find_library\\('tidy'\\)") (format #f "'~a'" libtidy))) @@ -24918,9 +24771,8 @@ It adds a simple and readable way to print stuff during development.") (lambda* (#:key inputs #:allow-other-keys) (setenv "TZ" "UTC") (setenv "TZDIR" - (string-append (assoc-ref inputs "tzdata") - "/share/zoneinfo")) - #t))))) + (search-input-directory inputs + "share/zoneinfo"))))))) (home-page "https://github.com/scrapinghub/dateparser") (synopsis "Date parsing library designed to parse dates from HTML pages") @@ -25038,7 +24890,7 @@ By default it uses the open Python vulnerability database Safety DB.") (propagated-inputs `(("wheel" ,python-wheel))) (native-inputs - `(("texlive" ,(texlive-union (list texlive-amsfonts/patched + `(("texlive" ,(texlive-updmap.cfg (list texlive-amsfonts texlive-fonts-ec texlive-latex-hyperref texlive-latex-oberdiek @@ -25053,8 +24905,6 @@ By default it uses the open Python vulnerability database Safety DB.") (substitute* "tests.py" (("test_basic_conversion_from_http_url") "skip_test_basic_conversion_from_http_url")) - ;; Needed by texlive-union to generate fonts - (setenv "HOME" "/tmp") #t))))) (home-page "https://github.com/bebraw/pypandoc") (synopsis "Python wrapper for pandoc") |