summaryrefslogtreecommitdiff
path: root/gnu/packages/python-web.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/python-web.scm')
-rw-r--r--gnu/packages/python-web.scm212
1 files changed, 107 insertions, 105 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index dcb84d0b67..a670fd8de0 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
-;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
;;; Copyright © 2013, 2014, 2015, 2016, 2020 Andreas Enge <andreas@enge.fr>
@@ -65,6 +65,7 @@
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system python)
+ #:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages base)
@@ -193,12 +194,9 @@ API rules.")
(string-append "@pytest.mark.xfail\n" all)))
;; Don't test the aiohttp pytest plugin to avoid a dependency loop.
- (delete-file "tests/test_pytest_plugin.py")
- #t))
+ (delete-file "tests/test_pytest_plugin.py")))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
- (setenv "PYTHONPATH"
- (string-append ".:" (getenv "PYTHONPATH")))
(if tests?
(invoke "pytest" "-vv"
;; Disable loading the aiohttp coverage plugin
@@ -333,9 +331,6 @@ comes with a SOCKS proxy client.")
'(#: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)
@@ -447,9 +442,6 @@ Model} (SAM) templates into AWS CloudFormation templates.")
"tests/ext/aiohttp/test_client.py"))))
(replace 'check
(lambda _
- (setenv "PYTHONPATH"
- (string-append "./build/lib:.:"
- (getenv "PYTHONPATH")))
(invoke "pytest" "-vv" "tests"))))))
(native-inputs
`(;; These are required for the test suite.
@@ -501,11 +493,6 @@ emit information from within their applications to the AWS X-Ray service.")
"test/unit/module/maintenance/test_update_documentation.py")
(delete-file
"test/unit/module/maintenance/test_update_resource_specs.py")
- (setenv "PYTHONPATH"
- (string-append "./build/lib:"
- (getenv "PYTHONPATH")))
- (setenv "PATH" (string-append out "/bin:"
- (getenv "PATH")))
(invoke "python" "-m" "unittest" "discover" "-v"
"-s" "test")))))))
(native-inputs
@@ -788,9 +775,6 @@ content using a variety of algorithms.")
`(#:phases (modify-phases %standard-phases
(replace 'check
(lambda _
- (setenv "PYTHONPATH"
- (string-append "./build/lib:"
- (getenv "PYTHONPATH")))
(invoke "pytest" "-vv"
;; Prevent running the flake8 and black
;; pytest plugins, which only tests style
@@ -1193,7 +1177,8 @@ and written in Python.")
`(("libxml2" ,libxml2)))
(propagated-inputs
`(("python-lxml" ,python-lxml)
- ("python-beautifulsoup4" ,python-beautifulsoup4)))
+ ("python-beautifulsoup4" ,python-beautifulsoup4)
+ ("python-chardet" ,python-chardet)))
(home-page "https://html5-parser.readthedocs.io")
(synopsis "Fast C-based HTML5 parsing for Python")
(description "This package provides a fast implementation of the HTML5
@@ -1483,9 +1468,6 @@ another XPath engine to find the matching elements in an XML or HTML document.")
`(#:phases (modify-phases %standard-phases
(replace 'check
(lambda _
- (setenv "PYTHONPATH"
- (string-append "./build/lib:"
- (getenv "PYTHONPATH")))
(invoke "pytest" "tests" "-vv"
;; XXX: This fails with newer Pytest
;; (upstream uses Pytest 3..).
@@ -1937,8 +1919,10 @@ conforming to a given API or contract.")
'(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda _
- (invoke "zope-testrunner" "--test-path=src"))))))
+ (lambda* (#:key tests? #:allow-other-keys)
+ (if tests?
+ (invoke "zope-testrunner" "--test-path=src")
+ (format #t "test suite not run~%")))))))
(native-inputs
`(("python-zope-testrunner" ,python-zope-testrunner-bootstrap)))
(propagated-inputs
@@ -1949,14 +1933,27 @@ conforming to a given API or contract.")
that have uses outside of the Zope framework.")
(license license:zpl2.1)))
-(define-public python-zope-exceptions-bootstrap
+(define (python-zope-bootstrap-package orig)
(package
- (inherit python-zope-exceptions)
- (arguments `(#:tests? #f))
+ (inherit orig)
+ (name (string-append (package-name orig) "-bootstrap"))
+ (arguments
+ (if (null? (package-arguments orig))
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (delete 'sanity-check)))
+ (substitute-keyword-arguments (package-arguments orig)
+ ((#:tests? _ #f) #f)
+ ((#:phases phases '%standard-phases)
+ `(modify-phases ,phases
+ (delete 'sanity-check))))))
(propagated-inputs `())
(native-inputs `())
(properties `((hidden? . #t)))))
+(define-public python-zope-exceptions-bootstrap
+ (python-zope-bootstrap-package python-zope-exceptions))
+
(define-public python2-zope-exceptions
(package-with-python2 python-zope-exceptions))
@@ -1994,7 +1991,15 @@ forms, HTTP servers, regular expressions, and more.")
"0jyyf1dcz156q95x2y7yw2v420q2xn3cff0c5aci7hmdmcbn0gc7"))))
(build-system python-build-system)
(arguments
- '(#:tests? #f)) ; FIXME: Tests can't find zope.interface.
+ '(#:tests? #f ;FIXME: Tests can't find zope.interface.
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'remove-problematic-test
+ (lambda _
+ ;; This test contains invalid syntax, which breaks bytecode
+ ;; compilation. For simplicity just remove it.
+ (delete-file
+ "src/zope/testrunner/tests/testrunner-ex/sample2/badsyntax.py"))))))
(native-inputs
`(("python-zope-testing" ,python-zope-testing)))
(propagated-inputs
@@ -2009,8 +2014,7 @@ tests.")
(define-public python-zope-testrunner-bootstrap
(package
- (inherit python-zope-testrunner)
- (arguments `(#:tests? #f))
+ (inherit (python-zope-bootstrap-package python-zope-testrunner))
(propagated-inputs
`(("python-six" ,python-six)
("python-zope-exceptions" ,python-zope-exceptions-bootstrap)))
@@ -2108,11 +2112,7 @@ Markup Language.")
(license license:zpl2.1)))
(define-public python-zope-configuration-bootstrap
- (package
- (inherit python-zope-configuration)
- (arguments `(#:tests? #f))
- (native-inputs `())
- (properties `((hidden? . #t)))))
+ (python-zope-bootstrap-package python-zope-configuration))
(define-public python2-zope-configuration
(package-with-python2 python-zope-configuration))
@@ -2175,11 +2175,7 @@ brokering, etc.) for which the proxy is responsible.")
(license license:zpl2.1)))
(define-public python-zope-proxy-bootstrap
- (package
- (inherit python-zope-proxy)
- (arguments `(#:tests? #f))
- (native-inputs `())
- (properties `((hidden? . #t)))))
+ (python-zope-bootstrap-package python-zope-proxy))
(define-public python2-zope-proxy
(package-with-python2 python-zope-proxy))
@@ -2236,11 +2232,7 @@ Zope3, which are are special objects that have a structural location.")
(license license:zpl2.1)))
(define-public python-zope-location-bootstrap
- (package
- (inherit python-zope-location)
- (arguments `(#:tests? #f))
- (native-inputs `())
- (properties `((hidden? . #t)))))
+ (python-zope-bootstrap-package python-zope-location))
(define-public python2-zope-location
(package-with-python2 python-zope-location))
@@ -2279,15 +2271,12 @@ security policies on Python objects.")
(define-public python-zope-security-bootstrap
(package
- (inherit python-zope-security)
- (arguments `(#:tests? #f))
+ (inherit (python-zope-bootstrap-package python-zope-security))
(propagated-inputs
`(("python-zope-i18nmessageid" ,python-zope-i18nmessageid)
("python-zope-interface" ,python-zope-interface)
("python-zope-proxy" ,python-zope-proxy-bootstrap)
- ("python-zope-schema" ,python-zope-schema)))
- (native-inputs `())
- (properties `((hidden? . #t)))))
+ ("python-zope-schema" ,python-zope-schema)))))
(define-public python2-zope-security
(package-with-python2 python-zope-security))
@@ -2308,9 +2297,10 @@ security policies on Python objects.")
'(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (add-installed-pythonpath inputs outputs)
- (invoke "python" "setup.py" "test"))))))
+ (lambda* (#:key tests? #:allow-other-keys)
+ (if tests?
+ (invoke "python" "setup.py" "test")
+ (format #t "test suite not run~%")))))))
(native-inputs
`(("python-persistent" ,python-persistent)
("python-zope-configuration" ,python-zope-configuration-bootstrap)
@@ -2334,11 +2324,7 @@ facilities for defining, registering and looking up components.")
(license license:zpl2.1)))
(define-public python-zope-component-bootstrap
- (package
- (inherit python-zope-component)
- (arguments `(#:tests? #f))
- (native-inputs `())
- (properties `((hidden? . #t)))))
+ (python-zope-bootstrap-package python-zope-component))
(define-public python2-zope-component
(package-with-python2 python-zope-component))
@@ -2788,15 +2774,14 @@ authenticated session objects providing things like keep-alive.")
(define-public python-urllib3
(package
(name "python-urllib3")
- (version "1.26.2")
+ (version "1.26.4")
(source
(origin
(method url-fetch)
(uri (pypi-uri "urllib3" version))
(sha256
(base32
- "024yldjwjavps39yb77sc422z8fa9bn20wcqrcncjwrqjab8y60r"))))
- (replacement python-urllib3/fixed)
+ "0dw9w9bs3hmr5dp3r3h43jyzzb1g1046ag7lj8pqf58i4kvj3c77"))))
(build-system python-build-system)
(arguments `(#:tests? #f))
(propagated-inputs
@@ -2815,18 +2800,6 @@ supports url redirection and retries, and also gzip and deflate decoding.")
(properties `((python2-variant . ,(delay python2-urllib3))))
(license license:expat)))
-(define python-urllib3/fixed
- (package
- (inherit python-urllib3)
- (version "1.26.7")
- (source
- (origin
- (method url-fetch)
- (uri (pypi-uri "urllib3" version))
- (sha256
- (base32
- "1kkf6gi8a1fs0dqkf6kpmdpsy97iirvliz8q1krxp8ppaiawd1s9"))))))
-
;; Some software requires an older version of urllib3, notably Docker.
(define-public python-urllib3-1.24
(package (inherit python-urllib3)
@@ -2974,22 +2947,21 @@ minimum of WSGI.")
(define-public python-flask
(package
(name "python-flask")
- (version "1.1.2")
+ (version "2.0.1")
(source (origin
(method url-fetch)
(uri (pypi-uri "Flask" version))
(sha256
(base32
- "0q3h295izcil7lswkzfnyg3k5gq4hpmqmpl6i7s5m1n9szi1myjf"))))
+ "0mcgwq7b4qd99mf5bsvs3wphchxarf8kgil4hwww3blj31xjak0w"))))
(build-system python-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda _
- (setenv "PYTHONPATH" (string-append "./build/lib:"
- (getenv "PYTHONPATH")))
- (invoke "pytest" "-vv" "tests"))))))
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv" "tests")))))))
(native-inputs
`(("python-pytest" ,python-pytest)))
(propagated-inputs
@@ -3021,8 +2993,6 @@ presume or force a developer to use a particular tool or library.")
(modify-phases %standard-phases
(replace 'check
(lambda _
- (setenv "PYTHONPATH" (string-append "./build/lib:"
- (getenv "PYTHONPATH")))
(invoke "pytest" "-vv"))))))
(propagated-inputs
`(("python-flask-babel" ,python-flask-babel)
@@ -3796,13 +3766,9 @@ for Flask.")
(lambda _
;; This test requires 'postcss' and 'babel' which are
;; not yet available in Guix.
- (delete-file "tests/test_filters.py")
- #t))
+ (delete-file "tests/test_filters.py")))
(replace 'check
(lambda _
- (setenv "PYTHONPATH"
- (string-append "./build/lib:"
- (getenv "PYTHONPATH")))
(invoke "pytest" "-vv"))))))
(native-inputs
`(("python-jinja2" ,python-jinja2)
@@ -4096,28 +4062,31 @@ List. Forked from and using the same API as the publicsuffix package.")
(define-public python-werkzeug
(package
(name "python-werkzeug")
- (version "1.0.1")
+ (version "2.0.1")
(source
(origin
(method url-fetch)
(uri (pypi-uri "Werkzeug" version))
(sha256
(base32
- "0z74sa1xw5h20yin9faj0vvdbq713cgbj84klc72jr9nmpjv303c"))))
+ "0hlwawnn8c41f254qify5jnjj8xb97n294h09bqimzqhs0qdpq8x"))))
(build-system python-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
- (delete 'check)
- (add-after 'install 'check
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (add-installed-pythonpath inputs outputs)
- (invoke "python" "-m" "pytest"))))))
+ (replace 'check
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (add-installed-pythonpath inputs outputs)
+ (invoke "python" "-m" "pytest"
+ ;; Test tries to use the network.
+ "-k not test_reloader_sys_path")))))))
(propagated-inputs
`(("python-requests" ,python-requests)))
(native-inputs
`(("python-pytest" ,python-pytest)
- ("python-pytest-timeout" ,python-pytest-timeout)))
+ ("python-pytest-timeout" ,python-pytest-timeout)
+ ("python-pytest-xprocess" ,python-pytest-xprocess)))
(home-page "https://palletsprojects.com/p/werkzeug/")
(synopsis "Utilities for WSGI applications")
(description "One of the most advanced WSGI utility modules. It includes a
@@ -4306,17 +4275,36 @@ name resolutions asynchronously.")
(define-public python-yarl
(package
(name "python-yarl")
- (version "1.1.1")
+ (version "1.6.3")
(source
(origin
(method url-fetch)
(uri (pypi-uri "yarl" version))
(sha256
(base32
- "1s6z13g8vgxfkkqwhn6imnm7pl7ky9arv4jygnn6bcndcbidg7d6"))))
+ "045z4ssg8g5h0qhz8hnx74hswgkndaldqq1xi5l1n5s0j996d44a"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ (delete-file "yarl/_quoting_c.c")))))
(build-system python-build-system)
+ (arguments
+ (list #:tests? #f ; test suite can't find yarl._quoting_c
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'cythonize-code
+ (lambda _
+ (invoke "cython" "yarl/_quoting_c.pyx")))
+ (replace 'check
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (substitute* "setup.cfg"
+ (("--cov=yarl") ""))
+ (add-installed-pythonpath inputs outputs)
+ (invoke "python" "-m" "pytest")))))))
(native-inputs
- `(("python-pytest" ,python-pytest)
+ `(("python-cython" ,python-cython)
+ ("python-pytest" ,python-pytest)
("python-pytest-runner" ,python-pytest-runner)))
(propagated-inputs
`(("python-idna" ,python-idna)
@@ -4359,7 +4347,15 @@ Google search engine. Its module is called @code{googlesearch}.")
"1wpbbbxfpy9mwxdy3kn352cb590ladv574j1aa2l4grjdqw3ln05"))))
(build-system python-build-system)
(arguments
- '(#:tests? #f)) ; tests require internet access
+ `(#:tests? #f ; tests require internet access
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-setup-py
+ (lambda _
+ (substitute* "setup.py"
+ (("googleapiclient/discovery_cache")
+ "googleapiclient.discovery_cache"))
+ #t)))))
(native-inputs
`(("python-httplib2" ,python-httplib2)
("python-six" ,python-six)
@@ -4572,7 +4568,8 @@ Python.")
(sha256
(base32 "0w22fapghmzk3xdasc4dn7h8sl58l08d1h5zbf72dh80drv1g9b9"))))
(propagated-inputs
- `(("python-unidecode" ,python-unidecode)))
+ `(("python-unidecode" ,python-unidecode)
+ ("python-text-unidecode" ,python-text-unidecode)))
(arguments
`(#:phases
(modify-phases %standard-phases
@@ -4800,14 +4797,11 @@ event loop. It is implemented in Cython and uses libuv under the hood.")
(lambda _
(invoke "make" "-C" "docs" "PAPER=a4" "html" "info")
(delete-file "docs/build/texinfo/Makefile")
- (delete-file "docs/build/texinfo/Gunicorn.texi")
- #t))
+ (delete-file "docs/build/texinfo/Gunicorn.texi")))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(if tests?
(begin
- (setenv "PYTHONPATH"
- (string-append ".:" (getenv "PYTHONPATH")))
(invoke "pytest" "-vv"
;; Disable the geventlet tests because eventlet uses
;; dnspython, which does not work in the build
@@ -5437,7 +5431,15 @@ files.")
(base32
"03s3ml6sbki24aajllf8aily0xzrn929zxi84p50zkkbikdd4raw"))))
(build-system python-build-system)
- (arguments '(#:tests? #f)) ; Tests not included in release tarball.
+ (arguments
+ '(#:tests? #f ; Tests not included in release tarball.
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-websockets-package-name-requirement
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Python package names use dot as separator.
+ (substitute* "setup.py"
+ (("websockets/extensions") "websockets.extensions")))))))
(home-page "https://github.com/aaugustin/websockets")
(synopsis
"Python implementation of the WebSocket Protocol (RFC 6455 & 7692)")