gnu: python-httptools: Update to 0.6.4.

* gnu/packages/python-web.scm (python-httptools): Update to 0.6.4.
  [source] <snippet>: Remove vendor.
  [arguments] <test-flags>: Skip only one test.
  <phases>: Remove 'preparation; add 'configure-build-ext.
  [build-system]: Use pyproject.
  [inputs]: Add llhttp.
  [native-inputs]: Add python-setuptools.

Change-Id: I81eaa61c96e2f41519648cccc625f2bc0a731269
This commit is contained in:
Sharlatan Hellseher 2025-08-04 23:23:43 +01:00
parent c7597fbacd
commit c7c3a87237
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -8178,7 +8178,7 @@ and fairly speedy.")
(define-public python-httptools
(package
(name "python-httptools")
(version "0.1.1")
(version "0.6.4")
(source
(origin
;; PyPI tarball comes with a vendored http-parser and no tests.
@ -8188,35 +8188,34 @@ and fairly speedy.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "0g08128x2ixsiwrzskxc6c8ymgzs39wbzr5mhy0mjk30q9pqqv77"))))
(build-system python-build-system)
(base32 "05zsa77jlm2h9z0vfj6gdqklj3pbzbijhk5s9b3q7iaxl347hwzc"))
(modules '((guix build utils)))
(snippet
#~(begin (delete-file-recursively "vendor")))))
(build-system pyproject-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'preparations
(list
#:test-flags
;; XXX: AssertionError: HttpParserError not raised.
#~(list "-k" "not test_parser_response_leninent_headers_1")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'configure-build-ext
(lambda _
;; Skip a failing test (AssertionError). Bug report:
;; https://github.com/MagicStack/httptools/issues/10.
(substitute* "tests/test_parser.py"
((" def test_parser_response_1")
(string-append
" @unittest.skip(\"Disabled.\")\n"
" def test_parser_response_1")))
;; Use packaged http-parser.
(substitute* "setup.py" (("self.use_system_http_parser = False")
"self.use_system_http_parser = True"))
;; This path is hardcoded. Hardcode our own.
(substitute* "httptools/parser/cparser.pxd"
(("../../vendor/http-parser")
(string-append (assoc-ref %build-inputs "http-parser")
"/include")))
;; Don't force Cython version.
(substitute* "setup.py" (("Cython==") "Cython>="))
#t)))))
(with-output-to-file "setup.cfg"
(lambda ()
(display "\
[build_ext]
use_system_llhttp = true
use_system_http_parser = true
cython_always = true"))))))))
(native-inputs
(list python-cython python-pytest))
(list python-cython
python-pytest
python-setuptools))
(inputs
(list http-parser))
(list http-parser
llhttp))
(home-page "https://github.com/MagicStack/httptools")
(synopsis "Collection of framework independent HTTP protocol utils")
(description