Skip to content

Conversation

ahnv
Copy link
Member

@ahnv ahnv commented Aug 22, 2025

This PR updates our CI, test fixtures, and dependency constraints to support newer Python and urllib3 versions while keeping compatibility with older runtimes. It also improves our GitHub Actions workflows and corrects several test mocks to align with real API behavior.

What’s changed

GitHub Actions

  • Move runners to ubuntu-22.04 and upgrade actions to actions/checkout@v5 and actions/setup-python@v5.
  • Test matrix now includes Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13.
  • Dual urllib3 lines tested via matrix:
    • lt2 → installs urllib3<2 (for 3.7/3.8 compatibility).
    • ge2 → installs urllib3!=2.0.0,<3 (tests v2 and future <3).
    • Excludes ge2 on Python 3.7 and 3.8, because urllib3>=2 does not support Python 3.7 or 3.8.
  • Split publish workflow:
    • build job runs tests across the matrix.
    • release job (Python 3.12) prepares build tooling (setuptools, wheel, twine).

Test Changes

  • Ensure mocked responses use content_type="application/json" where appropriate.
  • Remove unnecessary request "Content-Type" headers from test setups.
  • Avoid setting a body on 204 responses; add explicit content_type where the client inspects headers.
  • Update expected headers from "text/plain, application/json" to "application/json".

Purpose of Changes

  • Supporting urllib3 v2 while allowing v1 keeps broad compatibility (<3).
  • Expanding the Python matrix (incl. 3.13) future-proofs the SDK.
  • More accurate test fixtures reduce false positives and mirror real API behavior.
  • Modernized actions/runners improve reliability and security.

Compatibility

  • No breaking API changes to the SDK.
  • Runtime explicitly supports urllib3<3 and adjusts requests per Python version.
  • Python 3.7/3.8 remain supported and are tested against urllib3<2.

- Add env-marked pins:
  - Py>=3.9: requests>=2.32.2, urllib3!=2.0.0,<3
  - 3.7–3.8: requests<2.32, urllib3<2
  - 3.6: requests<2.28, urllib3<2
- Bump requests-toolbelt to >=1.0.0
- README: document per-Python resolver behavior
- CI: matrix runs both urllib3<2 and urllib3>=2 on appropriate Pythons

Refs:
- Requests now requires Python >=3.9; 2.32.0/2.32.1 yanked (start at 2.32.2).
- urllib3 2.x requires Python >=3.9.
- requests-toolbelt 1.0.0 aligns with urllib3 2.x.
@ahnv ahnv force-pushed the chore/urllib3-2x-compat-py36-38 branch from 473d132 to d5dd9b0 Compare August 22, 2025 09:49
@ahnv ahnv force-pushed the chore/urllib3-2x-compat-py36-38 branch from b3a8efc to bfc4cb1 Compare August 22, 2025 17:06
@ahnv ahnv force-pushed the chore/urllib3-2x-compat-py36-38 branch from bfc4cb1 to 53e6aaf Compare August 22, 2025 18:03
@ahnv ahnv changed the title deps: enable urllib3 2.x on Py>=3.9; keep Py<3.9 on urllib3<2 CI & deps: add Python 3.11–3.13, support urllib3 <3 (incl. v2) Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant