Skip to content

Modernize project tooling and align urllib3 usage with best practices - #13

Merged
johnbrandborg merged 3 commits into
mainfrom
feature/modernize-tooling-and-urllib3-best-practices
Feb 20, 2026
Merged

Modernize project tooling and align urllib3 usage with best practices#13
johnbrandborg merged 3 commits into
mainfrom
feature/modernize-tooling-and-urllib3-best-practices

Conversation

@johnbrandborg

@johnbrandborg johnbrandborg commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Consolidate configuration into pyproject.toml, removing setup.cfg, setup.py, and ruff.toml. Adopt uv as the package manager across Makefile and GitHub Actions (both CI and release workflows).
  • Upgrade Python from 3.9 (EOL) to 3.10+ minimum, add 3.13 to the CI matrix, and integrate Astral's ty static type checker with all 32 diagnostics resolved. Type hints modernised to 3.10+ syntax throughout.
  • Fix urllib3 best-practice issues: correct a URL-normalisation bug in delete(), fix an off-by-one status range in auth.py, add explicit cert_reqs for verify_ssl=False, replace the global urllib3.request() with a per-instance PoolManager in OAuth2, use urllib3.make_headers() for basic auth, and include POST/PATCH in the retry allowed_methods.

Test plan

  • ruff check -- all checks passed
  • ruff format --check -- all files formatted
  • ty check -- all checks passed
  • pytest -- 144 tests passed, 99% coverage
  • Verify CI pipeline passes on GitHub Actions (Python 3.10, 3.11, 3.12, 3.13)
  • Verify release workflow builds correctly with uv build

Made with Cursor

johnbrandborg and others added 3 commits February 20, 2026 12:38
Migrate build configuration from setup.cfg/setup.py/ruff.toml into a
single pyproject.toml. Adopt uv as the package manager, replacing pip
in the Makefile and GitHub Actions workflows. Upgrade minimum Python
version from 3.9 (EOL) to 3.10 and add 3.13 to the CI matrix.

Integrate Astral's ty static type checker, modernize type hints to
Python 3.10+ syntax (X | None, dict, list, tuple), and resolve all
32 reported diagnostics across source and test files.

Fix several urllib3 issues identified against current best practices:
- Bug: delete() used self.host + uri instead of the normalised url
- Bug: auth.py status range < 499 excluded valid 499 client errors
- Set cert_reqs explicitly so verify_ssl=False actually disables TLS
- Replace global urllib3.request() in auth.py with per-instance
  PoolManager to avoid shared side effects
- Use urllib3.make_headers() for basic auth encoding in core.py
- Add allowed_methods to Retry so POST/PATCH operations are retried

Co-authored-by: Cursor <cursoragent@cursor.com>
v4 is no longer supported and contains a security vulnerability per
the deprecation notice from SonarSource.

Co-authored-by: Cursor <cursoragent@cursor.com>
Minor version bump for dropping Python 3.9 support, modernized
tooling (pyproject.toml, uv, ty), and urllib3 best-practice fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

@johnbrandborg
johnbrandborg merged commit 94b0ae1 into main Feb 20, 2026
9 of 10 checks passed
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