Skip to content

Consistent handling of HTTP/S proxy environment variables#2079

Merged
tisonkun merged 4 commits intoapache:trunkfrom
davidwegs:no_proxy_support
Mar 13, 2026
Merged

Consistent handling of HTTP/S proxy environment variables#2079
tisonkun merged 4 commits intoapache:trunkfrom
davidwegs:no_proxy_support

Conversation

@davidwegs
Copy link
Contributor

Consistent handling of HTTP/S proxy environment variables

Description

This PR provides consistent handling of the http_proxy, https_proxy, and no_proxy environment variables in line with the behavior of the Requests python library. Previously no_proxy wasn't being respected (#2077).

This is done by removing explicit handling of the http_proxy and https_proxy env variables in favor of downstream handling through the Requests library. Explicitly provided proxy settings through the proxy_url argument to the connection class and through the set_http_proxy method are still supported and still take precedence over the environment variables.

Status

done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.36%. Comparing base (de03f1d) to head (34e8ab8).

Files with missing lines Patch % Lines
libcloud/test/test_connection.py 93.75% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #2079   +/-   ##
=======================================
  Coverage   83.36%   83.36%           
=======================================
  Files         353      353           
  Lines       81886    81906   +20     
  Branches     9004     9007    +3     
=======================================
+ Hits        68258    68278   +20     
  Misses      10799    10799           
  Partials     2829     2829           
Files with missing lines Coverage Δ
libcloud/http.py 92.09% <100.00%> (-0.22%) ⬇️
libcloud/test/test_connection.py 97.64% <93.75%> (+0.14%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tisonkun
Copy link
Member

tisonkun commented Mar 6, 2026

black-check: commands[1]> black --config pyproject.toml --check libcloud/
would reformat /home/runner/work/libcloud/libcloud/libcloud/test/test_connection.py

Oh no! 💥 💔 💥
1 file would be reformatted, 366 files would be left unchanged.
black-check: exit 1 (15.10 seconds) /home/runner/work/libcloud/libcloud> black --config pyproject.toml --check libcloud/ pid=3129
black-check: FAIL ✖ in 27.07 seconds

@davidwegs I'd approve this PR once the format issue get resolved :D

@davidwegs
Copy link
Contributor Author

Thanks @tisonkun! Format issue should be resolved now

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @davidwegs! LGTM.

cc @micafer if you have time to give a review as well

I'm going to merge this patch in days.

Copy link
Contributor

@micafer micafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tisonkun tisonkun merged commit 3fb37a2 into apache:trunk Mar 13, 2026
17 checks passed
@tisonkun
Copy link
Member

With one more approval I'd merge it now :D

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.

4 participants