chore: upgrade urllib to latest#240
Conversation
|
Hmmm, after upgrading from urllib3 1.26.0 to 2.5.0, the test There is an open issue on HttpPretty which is still open and is the cause of this error. Until that's resolved, we can mock the keyring in order to allow this individual test to pass. When running the test suite which includes all tests: Results in a pass. The |
…om-1x-to-2x-issue-150
There was a problem hiding this comment.
Pull request overview
This PR upgrades urllib3 from v1.26.20 to v2.5.0 to align with the urllib3 v2 migration guide. The changes include updating dependency constraints, adapting code to use the new urllib3 v2 API, and fixing test compatibility issues.
Key changes:
- Updated urllib3 version constraints in dependency files and migrated deprecated API parameters
- Added test fixture to handle urllib3 v2 socket shutdown behavior with httpretty mocking
- Fixed potential undefined variable issue in entitlements metrics command
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updated urllib3 dependency constraint from <2.0 to >=2.5 |
| requirements.txt | Updated pinned urllib3 version from 1.26.20 to 2.5.0 |
| cloudsmith_cli/core/rest.py | Replaced deprecated method_whitelist parameter with allowed_methods for urllib3 v2 compatibility |
| cloudsmith_cli/core/tests/test_rest.py | Added mock_keyring fixture to handle urllib3 v2 socket shutdown behavior and prevent SSO token refresh during isolated tests |
| cloudsmith_cli/cli/commands/metrics/entitlements.py | Added data = None initialization to prevent potential undefined variable issues |
| CHANGELOG.md | Documented urllib3 upgrade, test fixture addition, and entitlement token list command fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…om-1x-to-2x-issue-150
Upgrade urllib3 to 2.5
https://urllib3.readthedocs.io/en/latest/v2-migration-guide.html