gnu: gunicorn: Migrate 'check phase to pyproject-build-system.

* gnu/packages/python-web.scm (gunicorn)[arguments]
{phases}: Remove 'check phase and migrate its flags to...
{test-flags}: ...here.

Change-Id: I0635d386d91ef2476dd513787df166f1b181c03c
Signed-off-by: Steve George <steve@futurile.net>
This commit is contained in:
Nicolas Graves 2025-03-10 03:16:06 +01:00 committed by Andreas Enge
parent 2b8dd22bb9
commit 55d7b8f1f6
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

@ -7486,27 +7486,27 @@ event loop. It is implemented in Cython and uses libuv under the hood.")
(outputs '("out" "doc")) (outputs '("out" "doc"))
(build-system pyproject-build-system) (build-system pyproject-build-system)
(arguments (arguments
`(#:phases `(#:test-flags
(modify-phases %standard-phases ;; Disable the geventlet tests because eventlet uses dnspython, which
;; does not work in the build container due to lack of /etc/resolv.conf
'("--ignore=tests/workers/test_geventlet.py")
#:phases (modify-phases %standard-phases
(add-after 'build 'build-doc (add-after 'build 'build-doc
(lambda _ (lambda _
(invoke "make" "-C" "docs" "PAPER=a4" "html" "info") (invoke "make"
"-C"
"docs"
"PAPER=a4"
"html"
"info")
(delete-file "docs/build/texinfo/Makefile") (delete-file "docs/build/texinfo/Makefile")
(delete-file "docs/build/texinfo/Gunicorn.texi"))) (delete-file "docs/build/texinfo/Gunicorn.texi")))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(if tests?
(begin
(invoke "pytest" "-vv"
;; Disable the geventlet tests because eventlet uses
;; dnspython, which does not work in the build
;; container due to lack of /etc/resolv.conf, etc.
"--ignore=tests/workers/test_geventlet.py"))
(format #t "test suite not run~%"))))
(add-after 'install 'install-doc (add-after 'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((doc (string-append (assoc-ref outputs "doc") (let* ((doc (string-append (assoc-ref outputs "doc")
"/share/doc/" ,name "-" ,version)) "/share/doc/"
,name "-"
,version))
(html (string-append doc "/html")) (html (string-append doc "/html"))
(info (string-append doc "/info")) (info (string-append doc "/info"))
(examples (string-append doc "/examples"))) (examples (string-append doc "/examples")))
@ -7517,15 +7517,18 @@ event loop. It is implemented in Cython and uses libuv under the hood.")
(copy-recursively "docs/build/texinfo" info) (copy-recursively "docs/build/texinfo" info)
(copy-recursively "examples" examples) (copy-recursively "examples" examples)
(for-each (lambda (file) (for-each (lambda (file)
(copy-file file (string-append doc "/" file))) (copy-file file
(string-append doc "/" file)))
'("README.rst" "NOTICE" "LICENSE" "THANKS"))))) '("README.rst" "NOTICE" "LICENSE" "THANKS")))))
;; XXX: The wrap phase includes native inputs on PYTHONPATH, (see ;; XXX: The wrap phase includes native inputs on PYTHONPATH, (see
;; <https://bugs.gnu.org/25235>), leading to an inflated closure ;; <https://bugs.gnu.org/25235>), leading to an inflated closure
;; size. Override it to only add the essential entries. ;; size. Override it to only add the essential entries.
(replace 'wrap (replace 'wrap
(lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (lambda* (#:key native-inputs inputs outputs
#:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(python (assoc-ref (or native-inputs inputs) "python")) (python (assoc-ref (or native-inputs inputs)
"python"))
(sitedir (string-append "/lib/python" (sitedir (string-append "/lib/python"
(python-version python) (python-version python)
"/site-packages"))) "/site-packages")))
@ -7535,8 +7538,7 @@ event loop. It is implemented in Cython and uses libuv under the hood.")
(string-append output sitedir)) (string-append output sitedir))
(list python out)))))))))) (list python out))))))))))
(inputs (list bash-minimal)) (inputs (list bash-minimal))
(native-inputs (native-inputs (list binutils ;for ctypes.util.find_library()
(list binutils ;; for ctypes.util.find_library()
python-aiohttp python-aiohttp
python-gevent python-gevent
python-pytest python-pytest
@ -7546,7 +7548,8 @@ event loop. It is implemented in Cython and uses libuv under the hood.")
(propagated-inputs (list python-packaging python-setuptools python-wheel)) (propagated-inputs (list python-packaging python-setuptools python-wheel))
(home-page "https://gunicorn.org/") (home-page "https://gunicorn.org/")
(synopsis "Python WSGI HTTP Server for UNIX") (synopsis "Python WSGI HTTP Server for UNIX")
(description "Gunicorn Green Unicorn is a Python WSGI HTTP (description
"Gunicorn Green Unicorn is a Python WSGI HTTP
Server for UNIX. Its a pre-fork worker model ported from Rubys Server for UNIX. Its a pre-fork worker model ported from Rubys
Unicorn project. The Gunicorn server is broadly compatible with Unicorn project. The Gunicorn server is broadly compatible with
various web frameworks, simply implemented, light on server resources, various web frameworks, simply implemented, light on server resources,