Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sorting of proxy_map in PDMPyPIClient #3255

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

eltoder
Copy link
Contributor

@eltoder eltoder commented Nov 5, 2024

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

Sort proxy_map after constructing URLPatterns. URLPattern has logic to make more specific patterns sort first. Current code instead sorts URLs as strings, which orders them lexicographically. This means that URLs from no_proxy usually sort after URLs from all_proxy and so no_proxy settings have no effect.

Fixes #3254

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.30%. Comparing base (acb40b0) to head (a4a7d3b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3255   +/-   ##
=======================================
  Coverage   85.30%   85.30%           
=======================================
  Files         112      112           
  Lines       11351    11352    +1     
  Branches     2473     2473           
=======================================
+ Hits         9683     9684    +1     
  Misses       1140     1140           
  Partials      528      528           
Flag Coverage Δ
unittests 85.10% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sort proxy_map after constructing URLPatterns. URLPattern has logic to
make more specific patterns sort first. Current code instead sorts URLs
as strings, which orders them lexicographically. This means that URLs
from `no_proxy` usually sort *after* URLs from `all_proxy` and so
`no_proxy` settings have no effect.

Fixes pdm-project#3254
@frostming frostming merged commit 0097247 into pdm-project:main Nov 5, 2024
24 checks passed
@eltoder eltoder deleted the feature/session-proxy-sort branch November 5, 2024 01:09
frostming pushed a commit that referenced this pull request Nov 6, 2024
Sort proxy_map after constructing URLPatterns. URLPattern has logic to
make more specific patterns sort first. Current code instead sorts URLs
as strings, which orders them lexicographically. This means that URLs
from `no_proxy` usually sort *after* URLs from `all_proxy` and so
`no_proxy` settings have no effect.

Fixes #3254

Signed-off-by: Frost Ming <me@frostming.com>
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.

PDM ignores no_proxy when all_proxy is set
2 participants