summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2025-05-09 22:20:21 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-05-09 22:35:00 +0100
commit4205370e076d09c594192cecfcd34ca36432d01c (patch)
tree4ff925750a59a0c17e5ba0ca181c6dcc2bf9892f
parent72c671ac61e8d3bfd7c5beffbc31a6a25aa32d36 (diff)
gnu: python-httpretty: Switch to pyproject.
* gnu/packages/web.scm (python-httpretty): [build-system]: Switch to pyproject. [arguments] <test-flags>: Move exclude logic here and run only unit tests.. [native-inputs]: Remove python-coverage, python-eventlet, python-httplib2, python-nose, python-pyparsing, python-requests, and python-tornado; add python-mock, python-pytest, python-setuptools, and python-wheel. Change-Id: I8353e3d4d0937ff02202da5fc551ae3cfdf85459
-rw-r--r--gnu/packages/web.scm58
1 files changed, 36 insertions, 22 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index b3f998aca9..e337caf745 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -7212,37 +7212,51 @@ efficient where possible.")
(uri (pypi-uri "httpretty" version))
(sha256
(base32 "0s1vjdaf3pk2xd0hvi5f7p3jm2rgwpbc734jdp9r50m1smfhxpi0"))))
- (build-system python-build-system)
+ (build-system pyproject-build-system)
(arguments
(list
+ #:test-flags
+ ;; Only run Unit tests.
+ #~(list "--ignore=tests/bugfixes"
+ "--ignore=tests/functional"
+ "--ignore=tests/pyopenssl"
+ "-k" (string-join
+ ;; Tests pattern failing with one of these errors:
+ ;; AttributeError: '(str|bool|bytes|list|tuple)' object
+ ;; has no attribute 'should'
+ ;; AttributeError: 'function' object has no attribute
+ ;; 'when'
+ ;; AttributeError: 'AssertionBuilder' object has no
+ ;; attribute 'should_not'
+ (list "not fake_socket_passes_through"
+ "fakesock_socket"
+ "request_parse_body_when"
+ "test_Entry_class_normalizes_headers"
+ "test_has_request"
+ "test_httpretty_should_raise_proper"
+ "test_parse_request_line_connect"
+ "test_request_parse_querystring"
+ "test_request_string_representation"
+ "test_request_stubs_internals")
+ " and not "))
#:phases
- '(modify-phases %standard-phases
- (add-after 'unpack 'remove-rednose-dependency
- (lambda _
- (substitute* "setup.py"
- (("'rednose'") ""))
- (substitute* '("requirements.txt" "setup.cfg")
- (("rednose.*") ""))))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (setenv "EVENTLET_NO_GREENDNS" "YES")
- (invoke "nosetests" "--exclude=(passthrough|streaming|httpretty_should_handle)")))))))
+ #~(modify-phases %standard-phases
+ (add-before 'check 'pre-check
+ (lambda _
+ (setenv"EVENTLET_NO_GREENDNS" "yes"))))))
(native-inputs
(list nss-certs-for-test
- python-coverage
- python-eventlet
python-freezegun
- python-httplib2
- python-nose
- python-pyparsing
- python-requests
+ python-mock
+ python-pytest
+ python-setuptools
python-sure
- python-tornado))
+ python-wheel))
(home-page "https://httpretty.readthedocs.io")
(synopsis "HTTP client mock for Python")
- (description "@code{httpretty} is a helper for faking web requests,
-inspired by Ruby's @code{fakeweb}.")
+ (description
+ "@code{httpretty} is a helper for faking web requests,inspired by Ruby's
+@code{fakeweb}.")
(license license:expat)))
(define-public jo