diff options
Diffstat (limited to 'gnu/packages/python-web.scm')
-rw-r--r-- | gnu/packages/python-web.scm | 111 |
1 files changed, 95 insertions, 16 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index eef63351ef..94a0406ea7 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -65,6 +65,7 @@ ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com> ;;; Copyright © 2024 normally_js <normally_js@posteo.net> ;;; Copyright © 2024 Markku Korkeala <markku.korkeala@iki.fi> +;;; Copyright © 2024 Nguyễn Gia Phong <mcsinyx@disroot.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -83,6 +84,7 @@ (define-module (gnu packages python-web) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system cargo) #:use-module (guix build-system copy) #:use-module (guix build-system pyproject) #:use-module (guix build-system python) @@ -96,6 +98,8 @@ #:use-module (gnu packages bash) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages crates-io) + #:use-module (gnu packages crates-web) #:use-module (gnu packages curl) #:use-module (gnu packages databases) #:use-module (gnu packages django) @@ -122,6 +126,7 @@ #:use-module (gnu packages qt) #:use-module (gnu packages rdf) #:use-module (gnu packages rpc) + #:use-module (gnu packages rust-apps) #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) #:use-module (gnu packages texinfo) @@ -3442,6 +3447,46 @@ verification of the SSL peer.") (home-page "https://github.com/cedadev/ndg_httpsclient/") (license license:bsd-3))) +(define-public python-nh3 + (package + (name "python-nh3") + (version "0.2.17") + (source + (origin + (method url-fetch) + (uri (pypi-uri "nh3" version)) + (sha256 + (base32 "0a7hrca5bbbrz20cbqy16n8vaxf4v2q1r9zv9vjlbmn334d79l20")))) + (build-system cargo-build-system) + (arguments + (list + #:imported-modules `(,@%cargo-build-system-modules + ,@%pyproject-build-system-modules) + #:modules '((guix build cargo-build-system) + ((guix build pyproject-build-system) #:prefix py:) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (replace 'build (assoc-ref py:%standard-phases 'build)) + (replace 'install (assoc-ref py:%standard-phases 'install)) + ;; cargo-build-system's %standard-phases has 'check before 'install. + (delete 'check) + (add-after 'install 'check + (lambda* (#:key tests? inputs outputs #:allow-other-keys) + (when tests? + (py:add-installed-pythonpath inputs outputs) + (invoke "pytest" "-vv" "tests"))))) + #:cargo-inputs + `(("rust-ammonia" ,rust-ammonia-4) + ("rust-pyo3" ,rust-pyo3-0.21)) + #:install-source? #false)) + (native-inputs (list maturin python-pytest python-wrapper)) + (home-page "https://nh3.readthedocs.io") + (synopsis "Python bindings to Ammonia HTML sanitization library") + (description "This package provides Python bindings to Ammonia HTML +sanitizer Rust crate.") + (license license:expat))) + (define-public python-noiseprotocol (package (name "python-noiseprotocol") @@ -3606,13 +3651,13 @@ than Python’s urllib2 library.") (define-public python-requests-next (package (name "python-requests") - (version "2.31.0") + (version "2.32.3") (source (origin (method url-fetch) (uri (pypi-uri "requests" version)) (sha256 (base32 - "1qfidaynsrci4wymrw3srz8v1zy7xxpcna8sxpm91mwqixsmlb4l")))) + "0q5742pnibwy74169kacin3dmqg9jzmzk7qab5aq5caffcbm8djm")))) (build-system python-build-system) (propagated-inputs (list python-certifi @@ -6114,7 +6159,7 @@ event loop. It is implemented in Cython and uses libuv under the hood.") (base32 "1s7670qw36x90bgmazmgib170i5gnpyb2ypxzlla7y0mpasniag0")))) (outputs '("out" "doc")) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments `(#:phases (modify-phases %standard-phases @@ -6164,6 +6209,7 @@ event loop. It is implemented in Cython and uses libuv under the hood.") ,(map (lambda (output) (string-append output sitedir)) (list python out)))))))))) + (inputs (list bash-minimal)) (native-inputs (list binutils ;; for ctypes.util.find_library() python-aiohttp @@ -6181,6 +6227,21 @@ various web frameworks, simply implemented, light on server resources, and fairly speedy.") (license license:expat))) +(define-public gunicorn-next + (package + (inherit gunicorn) + (name "gunicorn") + (version "22.0.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "gunicorn" version)) + (sha256 + (base32 + "0qzc3ghayc137hlwrqqwkkhaf8f5h9ja21qwy4rznxpz75i462sa")))) + ;; CVE-2024-1135 is fixed in version 22.0.0. + (properties `((lint-hidden-cve . ("CVE-2024-1135")))))) + ;; break cyclic dependency for python-aiohttp, which depends on gunicorn for ;; its tests (define-public gunicorn-bootstrap @@ -6981,15 +7042,24 @@ changed the process is restarted.") (define-public python-pyowm (package (name "python-pyowm") - (version "3.2.0") + (version "3.3.0") (source (origin - (method url-fetch) - (uri (pypi-uri "pyowm" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/csparpa/pyowm") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 "1pm8w6phr4m3xayndfndid366vhf1fpvdgjsp2zicxarmgc0pm53")))) - (build-system python-build-system) - (propagated-inputs (list python-geojson python-pysocks python-requests)) + (base32 + "1ha4pp96y3jk33qnyir5851cnj4dc06q6wqn1b0w54l3fsds28vi")))) + (build-system pyproject-build-system) + (arguments (list #:test-flags #~(list "tests/unit"))) + (native-inputs (list python-pytest)) + (propagated-inputs + (list python-geojson-for-pyowm + python-pysocks + python-requests)) (home-page "https://github.com/csparpa/pyowm") (synopsis "Python wrapper around OpenWeatherMap web APIs") (description @@ -7399,7 +7469,7 @@ Encoding for HTTP.") (define-public python-cloud-init (package (name "python-cloud-init") - (version "23.4.3") + (version "24.2") (source (origin (method git-fetch) @@ -7408,7 +7478,7 @@ Encoding for HTTP.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0przjj2j1ws6b7sbgqxnffsarbbwl00lhq3bn7yiksp8kg8np1m1")))) + (base32 "18872z2y9wkh558y1bx5r0rksb4i584jbc8z4g8marwawhwxq506")))) (build-system pyproject-build-system) (arguments (list @@ -7422,6 +7492,7 @@ Encoding for HTTP.") (string-append ;; This test messes with PATH, so it cannot find mkdir "not test_path_env_gets_set_from_main" + " and not test_apt_configure_sources_list_" ;; These all fail because /bin/sh doesn't exist. We cannot patch ;; this because the generated scripts must use /bin/sh as they are ;; supposed to be run on minimal systems. @@ -7430,11 +7501,19 @@ Encoding for HTTP.") " and not test_subp_combined_stderr_stdout" " and not test_handle_part")) #:phases - '(modify-phases %standard-phases - (add-after 'unpack 'patch-references - (lambda _ - (substitute* "tests/unittests/cmd/test_clean.py" - (("#!/bin/sh") (string-append "#!" (which "sh"))))))))) + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-references + (lambda _ + (substitute* "tests/unittests/cmd/test_clean.py" + (("#!/bin/sh") (string-append "#!" (which "sh")))))) + (add-after 'install 'move-files + (lambda* (#:key inputs outputs #:allow-other-keys) + (for-each (lambda (dir) + (let ((source (string-append (site-packages inputs outputs) "/" dir)) + (target (string-append #$output "/" (basename dir)))) + (copy-recursively source target) + (delete-file-recursively source))) + (list "etc" "lib" "usr/lib" "usr/share"))))))) (propagated-inputs (list python-configobj python-jinja2 |