| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…cker
Raise the runtime floor to Python 3.10 (verified on 3.10 and 3.12) and
modernize the HTTP toolchain:
- python >=3.10,<4 (drop 3.9 from deps and CI matrix)
- httpx >=0.28, pytest-httpx >=0.35, inflect >=7
- dev: pytest >=8,<9, pytest-asyncio >=0.24,<2, pytest-cov <7
pytest-httpx >=0.35 (which pulls httpx 0.28) is the only path to httpx
0.28, and it forces the pytest/pytest-asyncio bumps transitively. Its
0.31+ API changes break the async mocker, so adapt it:
- HTTPXMock now requires _HTTPXMockOptions; construct it with
can_send_already_matched_responses=True so a single registered
response answers the ConnectClient's retried requests. The strict
assert_all_requests_were_expected default is kept, so an unmocked
request fails the test.
- reset() no longer performs assertions; call _assert_options()
explicitly, gated by success, to keep failing on unrequested mocks.
- match_content now serializes JSON with compact separators to match
httpx 0.28's compact request-body serialization.
Mark test_execute_error_with_reason (native httpx_mock fixture, retries
on 500) with the matching httpx_mock options. All tests pass.
connect/client/fluent.py imported `Proxy` from httpx._config and `get_environment_proxies` from httpx._utils. Both are private httpx APIs that can change or vanish on any minor release, and the import happens at module load, so a break would take down the whole client, not just proxy support. Reimplement the environment proxy discovery locally as _get_environment_proxies() on top of stdlib urllib.request.getproxies() and ipaddress, faithfully porting httpx 0.28's algorithm: http/https/all schemes (normalizing bare host:port to a http:// URL) and NO_PROXY handling for domains, IPv4, IPv6, localhost, explicit-scheme hosts, and the NO_PROXY=* global bypass. Use the public httpx.Proxy instead of the private one. Add tests for this previously untested logic (scheme normalization, each NO_PROXY host form, and the wildcard bypass). All 407 tests pass.
The install section still stated Python 3.9 as the minimum. Python 3.9 support was dropped on this branch (pyproject.toml now requires >=3.10), so align the README with the actual requirement.
There was a problem hiding this comment.
Requesting changes. Details in the inline comments.
Sorry, something went wrong.
Address PR review on the httpx 0.28 / pytest-httpx 0.35 bump. - match_content now mirrors httpx 0.28's request-body serialization exactly by adding ensure_ascii=False and allow_nan=False. Without them a non-ASCII match_body serialized to \uXXXX escapes while httpx sends raw UTF-8, so the mock silently failed to match. - Pin an upper bound pytest-httpx >=0.35,<1. It is a runtime dependency (connect.client.testing ships the mocker and a pytest11 plugin) that relies on private pytest_httpx API (_HTTPXMockOptions, _assert_options), so an unbounded minor bump could break downstream test suites. - Add test_create_match_non_ascii_body and test_unrequested_mock_fails to cover the non-ASCII matching and the reset() assertion path, which previously had no coverage.
|
Sorry, something went wrong.
connect-openapi-client 35.0 dropped its importlib-metadata<7 pin (cloudblue/connect-python-openapi-client#86), which was the only thing blocking interrogatio 2.4 (which needs importlib-metadata>=8.5). connect-openapi-client >=29 -> >=35 (34.0 -> 35.0) interrogatio ^2.3.1 -> ^2.4 (2.3.1 -> 2.4.0) importlib-metadata 6.x -> 8.9.0 httpx -> 0.28.1 (pulled by client 35) pytest-httpx 0.29.0 -> 0.35.0 (idem) sniffio removed (no longer required) Full suite: 715 passed.
Clean, targeted dependency refresh on top of current master, replacing the stale bot PR #248. Mirrors the sibling bump in cloudblue/connect-python-openapi-client#86. Test toolchain: pytest 7.2.2 -> 8.4.2 pytest-cov 2.12.1 -> 6.3.0 coverage 5.5 -> 7.14.3 responses 0.20.0 -> 0.26.1 pytest 8 changed collection ordering, exposing a latent isolation bug: tests/plugins/play/test_play_commands.py deletes and reimports connect.cli.ccli, so test_ccli.py's module-level 'from ... import main' bound to a stale module object that mocker.patch never touched. Fixed by importing main inside each test. Lint toolchain: flake8 5.0.4 -> 7.3.0 flake8-bugbear 22.12.6 -> 25.11.29 flake8-commas 2.1.0 -> 4.0.0 flake8-isort 5.0.3 -> 6.1.2 flake8-broken-line 0.5.0 -> 1.0.0 Only bugbear codes are enforced (select = "B"); bugbear 25 adds B017, which flagged a broad pytest.raises(Exception) in test_http.py masking the real ValueError; narrowed it. Runtime deps: connect-openapi-client >=29 -> >=35 (34.0 -> 35.0) interrogatio 2.3.1 -> 2.4.0 iso3166 1.0.1 -> 2.1.1 phonenumbers 8.13.55 -> 9.0.33 poetry-core 1.9.1 -> 2.4.1 click 8.3.1 -> 8.4.2 requests 2.32.5 -> 2.34.2 openapi-client 35.0 dropped its importlib-metadata<7 pin (#86), which unblocked interrogatio 2.4 (needs importlib-metadata>=8.5); that also pulls httpx 0.28.1 / pytest-httpx 0.35.0 and drops sniffio. Lint/format stack (black) and runtime majors gated upstream (eaas-core, reports-core, rich via markdown-renderer) are left untouched. Full suite: 715 passed.
| Back | FazBrowse Home | New Git URL |
What
Raise the runtime floor to Python 3.10 (verified on 3.10 and 3.12) and modernize the HTTP toolchain.
Why this is one change
We like to keep "updated" (now we support even 3.10 ) connect-cli and this dependency had pinned oudated versions.
API changes absorbed (pytest-httpx 0.31+ / httpx 0.28)
Adapted connect/client/testing/fluent.py:
Verification
All 399 tests pass on Python 3.10 and 3.12. flake8 clean on changed files.