diff options
Diffstat (limited to 'net-misc/httpie')
-rw-r--r-- | net-misc/httpie/Manifest | 4 | ||||
-rw-r--r-- | net-misc/httpie/files/httpie-3.2.1-pytest-fixtures.patch | 599 | ||||
-rw-r--r-- | net-misc/httpie/httpie-3.2.1-r1.ebuild | 45 | ||||
-rw-r--r-- | net-misc/httpie/httpie-3.2.2.ebuild | 83 |
4 files changed, 685 insertions, 46 deletions
diff --git a/net-misc/httpie/Manifest b/net-misc/httpie/Manifest index 5311e507d99b..59d8777854fe 100644 --- a/net-misc/httpie/Manifest +++ b/net-misc/httpie/Manifest @@ -1,5 +1,7 @@ +AUX httpie-3.2.1-pytest-fixtures.patch 19140 BLAKE2B df54635098d0da8b9b8c37dd4a144caf330f6ca9ca657de90ea510f91498735700b84b6ce48d91ff1ed88eecfa0d80a0ac626d2d8384a8ac68d9a7303d048509 SHA512 b881cefb48079ffa5ee0450e591185e15bf9052ecd16ccce7a5faddc7cc4cc9cf3f73cfcdde8dca129969b182086a2c1d867669261f91196df4318aae466a7b0 AUX httpie-urllib3-2-fixes.patch 1852 BLAKE2B 8298b18a64e0fc99f422d5c3260ca9b567de08f9cc7b0d2cb0c20ba675a717dd1e4cff03bc036beead71f58426153e2b040fea06e4383df768d004afdbd807e7 SHA512 c926450b4ef43274e0e70b51605ff020ccf82a0704d86814590cbe40db5ea1329ec357b7f630f860b09549f76a34211c3799956b67d8f2f0db51ad14c1ba53b9 DIST httpie-3.2.1.gh.tar.gz 1276550 BLAKE2B 627aa3db762e9e407f882be2c4267f5227301b189695537e7ac69ff140d6d39292251e131f9b9e7761e904a736d112bb4c1f5c6708c1468c6309474ee8c140b6 SHA512 ffcf6050138c49d5acb01f214d9b3fee6c78502c4c6dc45a295bafc88aafd1789f97a69c922f6e093fb48a402c1f83a7fff5307849130df81c4bcb2d595a03bf -EBUILD httpie-3.2.1-r1.ebuild 1199 BLAKE2B cc2325459fd6bfc94cccf18f4a33ef762009ddfeb2c23cde5af7ccf7785873e0cc0ef41e77ad85c8ddc30bbc1296d117b50edf2c997a6ca4e40a4fbda8dbda45 SHA512 b46af54de9bddeffb4649418342710e6324dfa4ea2ef6638caa07bc58f7aff809d8246475b57375fabaee2fb65118cf4964068d16be30d064bf20ac4a204267e +DIST httpie-3.2.2.gh.tar.gz 1279161 BLAKE2B aa5df73acbbe635fbfd3db458a2289042091a27d7b1791e9739874c1882e436814f74eec2b695f8acd76f9b9dd210f43dd9f8b7c0feea0cf4782b30f0e53b91a SHA512 5e95eba5a5ca8017dfd76ace525c57d2931d8918d51e84e8744eb9393cda5ae8e6cd6a1455c4aa82e50fa35edc35468a8b3582169c8f94858e61b09548cfa13d EBUILD httpie-3.2.1-r2.ebuild 1255 BLAKE2B 760084b16fbcd95341e67b24db2919dc84d75e20063fee3793245fc659a18bf816d64348a12aefa22f843d40e216da69588cdde8736f74b4c1b724c128e19502 SHA512 b984af94d3104df7956ede9485f563f23ef8835d50d0524de632f12b02ca2429ba4c2ba587c7023d82538fad3428b0103e9fca623e5ae0bfbc9ad9a3f9bd7d70 +EBUILD httpie-3.2.2.ebuild 3086 BLAKE2B bed66cc50988b57f716ffa0e9770f6398aa305730e77542e566efebf4b500a39f00349831943c63ee5576751d5105b62f7fadc9e305078c7def12e7b46b63dd6 SHA512 17a0f0fb01c191fc5730f8e7684545a95c47b50ed106af2e3d54ca5170c21daad7407e201530acefc7111a5761930202e7c874b4b3491e0c8baaf51638b43725 MISC metadata.xml 933 BLAKE2B a0e1a09be17802bd416493a82c30eeef966985e7e9dd75a0c00de03d36b90b52883cf274d5257f62e2881fad6c8505cfefe47394c2796b97c9973e8a82fd2598 SHA512 dcb5b425e423af7fe38f82f5f32d2cce740789e2f7cae1dbc32a0cf46b6cd1be107fbe9fffa139f9a699042681bdd37a0fa7141fcf8b991cdea8991ed89a694c diff --git a/net-misc/httpie/files/httpie-3.2.1-pytest-fixtures.patch b/net-misc/httpie/files/httpie-3.2.1-pytest-fixtures.patch new file mode 100644 index 000000000000..be3dc48d16b7 --- /dev/null +++ b/net-misc/httpie/files/httpie-3.2.1-pytest-fixtures.patch @@ -0,0 +1,599 @@ +https://github.com/httpie/cli/commit/3524ccf0baa9f2b3029368ab07ba5f64e62dcb1f +https://github.com/httpie/cli/commit/db16bbee961ceb93b7831fe1ec44a72d56a33e38 + +From 3524ccf0baa9f2b3029368ab07ba5f64e62dcb1f Mon Sep 17 00:00:00 2001 +From: Jakub Roztocil <jakub@roztocil.co> +Date: Mon, 4 Mar 2024 16:27:52 +0100 +Subject: [PATCH] Drop dependency on the abandoned python-lazy-fixture + +--- a/setup.py ++++ b/setup.py +@@ -11,7 +11,6 @@ + tests_require = [ + 'pytest', + 'pytest-httpbin>=0.0.6', +- 'pytest-lazy-fixture>=0.0.6', + 'responses', + 'pytest-mock', + 'werkzeug<2.1.0' +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -3,14 +3,14 @@ + import pytest + from pytest_httpbin import certs + +-from .utils import ( # noqa ++from .utils import ( # noqa + HTTPBIN_WITH_CHUNKED_SUPPORT_DOMAIN, + HTTPBIN_WITH_CHUNKED_SUPPORT, + REMOTE_HTTPBIN_DOMAIN, + IS_PYOPENSSL, + mock_env + ) +-from .utils.plugins_cli import ( # noqa ++from .utils.plugins_cli import ( # noqa + broken_plugin, + dummy_plugin, + dummy_plugins, +@@ -18,7 +18,9 @@ + httpie_plugins_success, + interface, + ) +-from .utils.http_server import http_server, localhost_http_server # noqa ++from .utils.http_server import http_server, localhost_http_server # noqa ++# noinspection PyUnresolvedReferences ++from .fixtures import pytest_lazy_fixture + + + @pytest.fixture(scope='function', autouse=True) +--- /dev/null ++++ b/tests/fixtures/pytest_lazy_fixture.py +@@ -0,0 +1,99 @@ ++""" ++Replacement for the abandoned `pytest.lazy_fixture` <https://github.com/TvoroG/pytest-lazy-fixture> ++ ++Based on <https://github.com/TvoroG/pytest-lazy-fixture/issues/65#issuecomment-1914581161> ++ ++""" ++import dataclasses ++import typing ++ ++import pytest ++ ++ ++@dataclasses.dataclass ++class LazyFixture: ++ """Lazy fixture dataclass.""" ++ ++ name: str ++ ++ ++def lazy_fixture(name: str) -> LazyFixture: ++ """Mark a fixture as lazy.""" ++ return LazyFixture(name) ++ ++ ++# NOTE: Mimic the original API ++pytest.lazy_fixture = lazy_fixture ++ ++ ++def is_lazy_fixture(value: object) -> bool: ++ """Check whether a value is a lazy fixture.""" ++ return isinstance(value, LazyFixture) ++ ++ ++def pytest_make_parametrize_id( ++ config: pytest.Config, ++ val: object, ++ argname: str, ++) -> str | None: ++ """Inject lazy fixture parametrized id. ++ ++ Reference: ++ - https://bit.ly/48Off6r ++ ++ Args: ++ config (pytest.Config): pytest configuration. ++ value (object): fixture value. ++ argname (str): automatic parameter name. ++ ++ Returns: ++ str: new parameter id. ++ """ ++ if is_lazy_fixture(val): ++ return typing.cast(LazyFixture, val).name ++ return None ++ ++ ++@pytest.hookimpl(tryfirst=True) ++def pytest_fixture_setup( ++ fixturedef: pytest.FixtureDef, ++ request: pytest.FixtureRequest, ++) -> object | None: ++ """Lazy fixture setup hook. ++ ++ This hook will never take over a fixture setup but just simply will ++ try to resolve recursively any lazy fixture found in request.param. ++ ++ Reference: ++ - https://bit.ly/3SyvsXJ ++ ++ Args: ++ fixturedef (pytest.FixtureDef): fixture definition object. ++ request (pytest.FixtureRequest): fixture request object. ++ ++ Returns: ++ object | None: fixture value or None otherwise. ++ """ ++ if hasattr(request, "param") and request.param: ++ request.param = _resolve_lazy_fixture(request.param, request) ++ return None ++ ++ ++def _resolve_lazy_fixture(__val: object, request: pytest.FixtureRequest) -> object: ++ """Lazy fixture resolver. ++ ++ Args: ++ __val (object): fixture value object. ++ request (pytest.FixtureRequest): pytest fixture request object. ++ ++ Returns: ++ object: resolved fixture value. ++ """ ++ if isinstance(__val, list | tuple): ++ return tuple(_resolve_lazy_fixture(v, request) for v in __val) ++ if isinstance(__val, typing.Mapping): ++ return {k: _resolve_lazy_fixture(v, request) for k, v in __val.items()} ++ if not is_lazy_fixture(__val): ++ return __val ++ lazy_obj = typing.cast(LazyFixture, __val) ++ return request.getfixturevalue(lazy_obj.name) + +From db16bbee961ceb93b7831fe1ec44a72d56a33e38 Mon Sep 17 00:00:00 2001 +From: Jakub Roztocil <jakub@roztocil.co> +Date: Mon, 4 Mar 2024 18:05:26 +0100 +Subject: [PATCH] Drop dependency on the abandoned python-lazy-fixture II. + +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -2,6 +2,7 @@ + + import pytest + from pytest_httpbin import certs ++from pytest_httpbin.serve import Server as PyTestHttpBinServer + + from .utils import ( # noqa + HTTPBIN_WITH_CHUNKED_SUPPORT_DOMAIN, +@@ -19,8 +20,10 @@ + interface, + ) + from .utils.http_server import http_server, localhost_http_server # noqa +-# noinspection PyUnresolvedReferences +-from .fixtures import pytest_lazy_fixture ++ ++ ++# Patch to support `url = str(server)` in addition to `url = server + '/foo'`. ++PyTestHttpBinServer.__str__ = lambda self: self.url + + + @pytest.fixture(scope='function', autouse=True) +@@ -72,8 +75,15 @@ def _remote_httpbin_available(): + + @pytest.fixture + def remote_httpbin(_remote_httpbin_available): ++ + if _remote_httpbin_available: +- return 'http://' + REMOTE_HTTPBIN_DOMAIN ++ class Server(str): ++ """Look like `pytest_httpbin.serve.Server` but only provide URL info.""" ++ @property ++ def url(self): ++ return self ++ ++ return Server('http://' + REMOTE_HTTPBIN_DOMAIN) + pytest.skip(f'{REMOTE_HTTPBIN_DOMAIN} not resolvable') + + +--- a/tests/fixtures/pytest_lazy_fixture.py ++++ /dev/null +@@ -1,99 +0,0 @@ +-""" +-Replacement for the abandoned `pytest.lazy_fixture` <https://github.com/TvoroG/pytest-lazy-fixture> +- +-Based on <https://github.com/TvoroG/pytest-lazy-fixture/issues/65#issuecomment-1914581161> +- +-""" +-import dataclasses +-import typing +- +-import pytest +- +- +-@dataclasses.dataclass +-class LazyFixture: +- """Lazy fixture dataclass.""" +- +- name: str +- +- +-def lazy_fixture(name: str) -> LazyFixture: +- """Mark a fixture as lazy.""" +- return LazyFixture(name) +- +- +-# NOTE: Mimic the original API +-pytest.lazy_fixture = lazy_fixture +- +- +-def is_lazy_fixture(value: object) -> bool: +- """Check whether a value is a lazy fixture.""" +- return isinstance(value, LazyFixture) +- +- +-def pytest_make_parametrize_id( +- config: pytest.Config, +- val: object, +- argname: str, +-) -> str | None: +- """Inject lazy fixture parametrized id. +- +- Reference: +- - https://bit.ly/48Off6r +- +- Args: +- config (pytest.Config): pytest configuration. +- value (object): fixture value. +- argname (str): automatic parameter name. +- +- Returns: +- str: new parameter id. +- """ +- if is_lazy_fixture(val): +- return typing.cast(LazyFixture, val).name +- return None +- +- +-@pytest.hookimpl(tryfirst=True) +-def pytest_fixture_setup( +- fixturedef: pytest.FixtureDef, +- request: pytest.FixtureRequest, +-) -> object | None: +- """Lazy fixture setup hook. +- +- This hook will never take over a fixture setup but just simply will +- try to resolve recursively any lazy fixture found in request.param. +- +- Reference: +- - https://bit.ly/3SyvsXJ +- +- Args: +- fixturedef (pytest.FixtureDef): fixture definition object. +- request (pytest.FixtureRequest): fixture request object. +- +- Returns: +- object | None: fixture value or None otherwise. +- """ +- if hasattr(request, "param") and request.param: +- request.param = _resolve_lazy_fixture(request.param, request) +- return None +- +- +-def _resolve_lazy_fixture(__val: object, request: pytest.FixtureRequest) -> object: +- """Lazy fixture resolver. +- +- Args: +- __val (object): fixture value object. +- request (pytest.FixtureRequest): pytest fixture request object. +- +- Returns: +- object: resolved fixture value. +- """ +- if isinstance(__val, list | tuple): +- return tuple(_resolve_lazy_fixture(v, request) for v in __val) +- if isinstance(__val, typing.Mapping): +- return {k: _resolve_lazy_fixture(v, request) for k, v in __val.items()} +- if not is_lazy_fixture(__val): +- return __val +- lazy_obj = typing.cast(LazyFixture, __val) +- return request.getfixturevalue(lazy_obj.name) +--- a/tests/test_cookie_on_redirects.py ++++ b/tests/test_cookie_on_redirects.py +@@ -2,54 +2,47 @@ + from .utils import http + + +-def _stringify(fixture): +- return fixture + '' +- +- +-@pytest.mark.parametrize('instance', [ +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('remote_httpbin'), ++@pytest.mark.parametrize('target_httpbin', [ ++ 'httpbin', ++ 'remote_httpbin', + ]) +-def test_explicit_user_set_cookie(httpbin, instance): +- # User set cookies ARE NOT persisted within redirects +- # when there is no session, even on the same domain. +- ++def test_explicit_user_set_cookie(httpbin, target_httpbin, request): ++ """User set cookies ARE NOT persisted within redirects when there is no session, even on the same domain.""" ++ target_httpbin = request.getfixturevalue(target_httpbin) + r = http( + '--follow', + httpbin + '/redirect-to', +- f'url=={_stringify(instance)}/cookies', ++ f'url=={target_httpbin.url}/cookies', + 'Cookie:a=b' + ) + assert r.json == {'cookies': {}} + + +-@pytest.mark.parametrize('instance', [ +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('remote_httpbin'), ++@pytest.mark.parametrize('target_httpbin', [ ++ 'httpbin', ++ 'remote_httpbin', + ]) +-def test_explicit_user_set_cookie_in_session(tmp_path, httpbin, instance): +- # User set cookies ARE persisted within redirects +- # when there is A session, even on the same domain. +- ++def test_explicit_user_set_cookie_in_session(tmp_path, httpbin, target_httpbin, request): ++ """User set cookies ARE persisted within redirects when there is A session, even on the same domain.""" ++ target_httpbin = request.getfixturevalue(target_httpbin) + r = http( + '--follow', + '--session', + str(tmp_path / 'session.json'), + httpbin + '/redirect-to', +- f'url=={_stringify(instance)}/cookies', ++ f'url=={target_httpbin}/cookies', + 'Cookie:a=b' + ) + assert r.json == {'cookies': {'a': 'b'}} + + +-@pytest.mark.parametrize('instance', [ +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('remote_httpbin'), ++@pytest.mark.parametrize('target_httpbin', [ ++ 'httpbin', ++ 'remote_httpbin', + ]) +-def test_saved_user_set_cookie_in_session(tmp_path, httpbin, instance): +- # User set cookies ARE persisted within redirects +- # when there is A session, even on the same domain. +- ++def test_saved_user_set_cookie_in_session(tmp_path, httpbin, target_httpbin, request): ++ """User set cookies ARE persisted within redirects when there is A session, even on the same domain.""" ++ target_httpbin = request.getfixturevalue(target_httpbin) + http( + '--follow', + '--session', +@@ -62,32 +55,33 @@ def test_saved_user_set_cookie_in_session(tmp_path, httpbin, instance): + '--session', + str(tmp_path / 'session.json'), + httpbin + '/redirect-to', +- f'url=={_stringify(instance)}/cookies', ++ f'url=={target_httpbin}/cookies', + ) + assert r.json == {'cookies': {'a': 'b'}} + + +-@pytest.mark.parametrize('instance', [ +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('remote_httpbin'), ++@pytest.mark.parametrize('target_httpbin', [ ++ 'httpbin', ++ 'remote_httpbin', + ]) + @pytest.mark.parametrize('session', [True, False]) +-def test_explicit_user_set_headers(httpbin, tmp_path, instance, session): +- # User set headers ARE persisted within redirects +- # even on different domains domain with or without +- # an active session. ++def test_explicit_user_set_headers(httpbin, tmp_path, target_httpbin, session, request): ++ """ ++ User set headers ARE persisted within redirects even on different domains domain with or without an active session. ++ ++ """ ++ target_httpbin = request.getfixturevalue(target_httpbin) + session_args = [] + if session: + session_args.extend([ + '--session', + str(tmp_path / 'session.json') + ]) +- + r = http( + '--follow', + *session_args, + httpbin + '/redirect-to', +- f'url=={_stringify(instance)}/get', ++ f'url=={target_httpbin}/get', + 'X-Custom-Header:value' + ) + assert 'X-Custom-Header' in r.json['headers'] +@@ -95,16 +89,13 @@ def test_explicit_user_set_headers(httpbin, tmp_path, instance, session): + + @pytest.mark.parametrize('session', [True, False]) + def test_server_set_cookie_on_redirect_same_domain(tmp_path, httpbin, session): +- # Server set cookies ARE persisted on the same domain +- # when they are forwarded. +- ++ """Server set cookies ARE persisted on the same domain when they are forwarded.""" + session_args = [] + if session: + session_args.extend([ + '--session', + str(tmp_path / 'session.json') + ]) +- + r = http( + '--follow', + *session_args, +@@ -136,8 +127,7 @@ def test_server_set_cookie_on_redirect_different_domain(tmp_path, http_server, h + + + def test_saved_session_cookies_on_same_domain(tmp_path, httpbin): +- # Saved session cookies ARE persisted when making a new +- # request to the same domain. ++ """Saved session cookies ARE persisted when making a new request to the same domain.""" + http( + '--session', + str(tmp_path / 'session.json'), +@@ -152,8 +142,7 @@ def test_saved_session_cookies_on_same_domain(tmp_path, httpbin): + + + def test_saved_session_cookies_on_different_domain(tmp_path, httpbin, remote_httpbin): +- # Saved session cookies ARE persisted when making a new +- # request to a different domain. ++ """Saved session cookies ARE persisted when making a new request to a different domain.""" + http( + '--session', + str(tmp_path / 'session.json'), +@@ -167,45 +156,49 @@ def test_saved_session_cookies_on_different_domain(tmp_path, httpbin, remote_htt + assert r.json == {'cookies': {}} + + +-@pytest.mark.parametrize('initial_domain, first_request_domain, second_request_domain, expect_cookies', [ ++@pytest.mark.parametrize(['initial_domain', 'first_request_domain', 'second_request_domain', 'expect_cookies'], [ + ( + # Cookies are set by Domain A + # Initial domain is Domain A + # Redirected domain is Domain A +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('httpbin'), ++ 'httpbin', ++ 'httpbin', ++ 'httpbin', + True, + ), + ( + # Cookies are set by Domain A + # Initial domain is Domain B + # Redirected domain is Domain B +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('remote_httpbin'), +- pytest.lazy_fixture('remote_httpbin'), ++ 'httpbin', ++ 'remote_httpbin', ++ 'remote_httpbin', + False, + ), + ( + # Cookies are set by Domain A + # Initial domain is Domain A + # Redirected domain is Domain B +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('remote_httpbin'), ++ 'httpbin', ++ 'httpbin', ++ 'remote_httpbin', + False, + ), + ( + # Cookies are set by Domain A + # Initial domain is Domain B + # Redirected domain is Domain A +- pytest.lazy_fixture('httpbin'), +- pytest.lazy_fixture('remote_httpbin'), +- pytest.lazy_fixture('httpbin'), ++ 'httpbin', ++ 'remote_httpbin', ++ 'httpbin', + True, + ), + ]) +-def test_saved_session_cookies_on_redirect(tmp_path, initial_domain, first_request_domain, second_request_domain, expect_cookies): ++def test_saved_session_cookies_on_redirect( ++ tmp_path, initial_domain, first_request_domain, second_request_domain, expect_cookies, request): ++ initial_domain = request.getfixturevalue(initial_domain) ++ first_request_domain = request.getfixturevalue(first_request_domain) ++ second_request_domain = request.getfixturevalue(second_request_domain) + http( + '--session', + str(tmp_path / 'session.json'), +@@ -216,7 +209,7 @@ def test_saved_session_cookies_on_redirect(tmp_path, initial_domain, first_reque + str(tmp_path / 'session.json'), + '--follow', + first_request_domain + '/redirect-to', +- f'url=={_stringify(second_request_domain)}/cookies' ++ f'url=={second_request_domain}/cookies' + ) + if expect_cookies: + expected_data = {'cookies': {'a': 'b'}} +--- a/tests/test_sessions.py ++++ b/tests/test_sessions.py +@@ -821,16 +821,17 @@ def test_session_multiple_headers_with_same_name(basic_session, httpbin): + 'server, expected_cookies', + [ + ( +- pytest.lazy_fixture('localhost_http_server'), ++ 'localhost_http_server', + {'secure_cookie': 'foo', 'insecure_cookie': 'bar'} + ), + ( +- pytest.lazy_fixture('remote_httpbin'), ++ 'remote_httpbin', + {'insecure_cookie': 'bar'} + ) + ] + ) +-def test_secure_cookies_on_localhost(mock_env, tmp_path, server, expected_cookies): ++def test_secure_cookies_on_localhost(mock_env, tmp_path, server, expected_cookies, request): ++ server = request.getfixturevalue(server) + session_path = tmp_path / 'session.json' + http( + '--session', str(session_path), +--- a/tests/test_update_warnings.py ++++ b/tests/test_update_warnings.py +@@ -132,10 +132,10 @@ def test_check_updates_first_invocation( + + + @pytest.mark.parametrize( +- 'should_issue_warning, build_channel', ++ ['should_issue_warning', 'build_channel'], + [ +- (False, pytest.lazy_fixture('lower_build_channel')), +- (True, pytest.lazy_fixture('higher_build_channel')), ++ (False, 'lower_build_channel'), ++ (True, 'higher_build_channel'), + ], + ) + def test_check_updates_first_time_after_data_fetch( +@@ -145,7 +145,9 @@ def test_check_updates_first_time_after_data_fetch( + static_fetch_data, + should_issue_warning, + build_channel, ++ request, + ): ++ request.getfixturevalue(build_channel) + http('fetch_updates', '--daemon', env=with_warnings) + r = http(httpbin + '/get', env=with_warnings) + +@@ -176,14 +178,15 @@ def test_cli_check_updates( + + + @pytest.mark.parametrize( +- "build_channel", [ +- pytest.lazy_fixture("lower_build_channel"), +- pytest.lazy_fixture("unknown_build_channel") ++ 'build_channel', [ ++ 'lower_build_channel', ++ 'unknown_build_channel', + ] + ) + def test_cli_check_updates_not_shown( +- static_fetch_data, build_channel ++ static_fetch_data, build_channel, request + ): ++ request.getfixturevalue(build_channel) + r = httpie('cli', 'check-updates') + assert r.exit_status == ExitStatus.SUCCESS + assert not check_update_warnings(r) diff --git a/net-misc/httpie/httpie-3.2.1-r1.ebuild b/net-misc/httpie/httpie-3.2.1-r1.ebuild deleted file mode 100644 index 8408d5324ea8..000000000000 --- a/net-misc/httpie/httpie-3.2.1-r1.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{9..11} ) -PYTHON_REQ_USE="ssl(+)" -DISTUTILS_USE_PEP517=setuptools - -inherit bash-completion-r1 distutils-r1 - -DESCRIPTION="Modern command line HTTP client" -HOMEPAGE="https://httpie.io/ https://pypi.org/project/httpie/" -SRC_URI="https://github.com/httpie/httpie/archive/${PV}.tar.gz -> ${P}.gh.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 x86" - -RDEPEND=" - dev-python/charset-normalizer[${PYTHON_USEDEP}] - dev-python/defusedxml[${PYTHON_USEDEP}] - dev-python/pygments[${PYTHON_USEDEP}] - dev-python/multidict[${PYTHON_USEDEP}] - dev-python/rich[${PYTHON_USEDEP}] - >=dev-python/requests-2.22.0[${PYTHON_USEDEP}] - >=dev-python/requests-toolbelt-0.9.1[${PYTHON_USEDEP}] -" -BDEPEND=" - test? ( - ${RDEPEND} - dev-python/pyopenssl[${PYTHON_USEDEP}] - dev-python/pytest-httpbin[${PYTHON_USEDEP}] - dev-python/responses[${PYTHON_USEDEP}] - ) -" - -distutils_enable_tests pytest - -python_install_all() { - newbashcomp extras/httpie-completion.bash http - insinto /usr/share/fish/vendor_completions.d - newins extras/httpie-completion.fish http.fish - distutils-r1_python_install_all -} diff --git a/net-misc/httpie/httpie-3.2.2.ebuild b/net-misc/httpie/httpie-3.2.2.ebuild new file mode 100644 index 000000000000..d6672c06715a --- /dev/null +++ b/net-misc/httpie/httpie-3.2.2.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_REQ_USE="ssl(+)" +DISTUTILS_USE_PEP517=setuptools + +inherit bash-completion-r1 distutils-r1 + +DESCRIPTION="Modern command line HTTP client" +HOMEPAGE="https://httpie.io/ https://pypi.org/project/httpie/" +SRC_URI="https://github.com/httpie/cli/archive/${PV}.tar.gz -> ${P}.gh.tar.gz" +S="${WORKDIR}"/cli-${PV} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + dev-python/charset-normalizer[${PYTHON_USEDEP}] + dev-python/defusedxml[${PYTHON_USEDEP}] + dev-python/pygments[${PYTHON_USEDEP}] + dev-python/multidict[${PYTHON_USEDEP}] + dev-python/rich[${PYTHON_USEDEP}] + >=dev-python/requests-2.22.0[${PYTHON_USEDEP}] + >=dev-python/requests-toolbelt-0.9.1[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + ${RDEPEND} + dev-python/pyopenssl[${PYTHON_USEDEP}] + dev-python/pytest-httpbin[${PYTHON_USEDEP}] + dev-python/pytest-mock[${PYTHON_USEDEP}] + dev-python/responses[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}/${PN}-3.2.1-pytest-fixtures.patch" +) + +EPYTEST_DESELECT=( + # https://github.com/httpie/cli/issues/1530 + tests/test_compress.py::test_compress_form + tests/test_binary.py::TestBinaryResponseData + + # Needs network + 'tests/test_cookie_on_redirects.py::test_explicit_user_set_cookie_in_session[remote_httpbin]' + 'tests/test_cookie_on_redirects.py::test_explicit_user_set_cookie[remote_httpbin]' + 'tests/test_cookie_on_redirects.py::test_explicit_user_set_headers[False-remote_httpbin]' + 'tests/test_cookie_on_redirects.py::test_explicit_user_set_headers[True-remote_httpbin]' + tests/test_cookie_on_redirects.py::test_saved_session_cookie_pool + tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_different_domain + 'tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_redirect[httpbin-httpbin-remote_httpbin-False]' + 'tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_redirect[httpbin-remote_httpbin-httpbin-True]' + 'tests/test_cookie_on_redirects.py::test_saved_session_cookies_on_redirect[httpbin-remote_httpbin-remote_httpbin-False]' + 'tests/test_cookie_on_redirects.py::test_saved_user_set_cookie_in_session[remote_httpbin]' + 'tests/test_sessions.py::test_secure_cookies_on_localhost[remote_httpbin-expected_cookies1]' + tests/test_tokens.py::test_verbose_chunked + tests/test_uploads.py::test_chunked_form + tests/test_uploads.py::test_chunked_json + tests/test_uploads.py::test_chunked_raw + tests/test_uploads.py::test_chunked_stdin + tests/test_uploads.py::test_chunked_stdin_multiple_chunks + tests/test_uploads.py::TestMultipartFormDataFileUpload::test_multipart_chunked + tests/test_uploads.py::TestRequestBodyFromFilePath::test_request_body_from_file_by_path_chunked +) + +EPYTEST_IGNORE=( + # Assumes installation in a clean venv + tests/test_plugins_cli.py +) + +distutils_enable_tests pytest + +python_install_all() { + newbashcomp extras/httpie-completion.bash http + insinto /usr/share/fish/vendor_completions.d + newins extras/httpie-completion.fish http.fish + distutils-r1_python_install_all +} |