Skip to content

Commit

Permalink
Merge pull request #5994 from mungojam/fix-keyring-warnings
Browse files Browse the repository at this point in the history
* pass through pipfile index urls when creating https session so that keyring works
* Add news entry
  • Loading branch information
matteius committed Nov 12, 2023
2 parents b75f496 + 023b6bc commit bc668e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/5994.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pass through pipfile index urls when creating https session so that keyring fully works
1 change: 1 addition & 0 deletions pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def get_requests_session_for_source(self, source):
self.s.PIPENV_MAX_RETRIES,
source.get("verify_ssl", True),
cache_dir=self.s.PIPENV_CACHE_DIR,
source=source.get("url"),
)
self.sessions[source["name"]] = session
return session
Expand Down
9 changes: 7 additions & 2 deletions pipenv/utils/internet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
from pipenv.patched.pip._vendor.urllib3 import util as urllib3_util


def get_requests_session(max_retries=1, verify_ssl=True, cache_dir=USER_CACHE_DIR):
def get_requests_session(
max_retries=1, verify_ssl=True, cache_dir=USER_CACHE_DIR, source=None
):
"""Load requests lazily."""
pip_client_cert = os.environ.get("PIP_CLIENT_CERT")
requests_session = PipSession(cache=cache_dir, retries=max_retries)
index_urls = [source] if source else None
requests_session = PipSession(
cache=cache_dir, retries=max_retries, index_urls=index_urls
)
if pip_client_cert:
requests_session.cert = pip_client_cert
if verify_ssl is False:
Expand Down

0 comments on commit bc668e6

Please sign in to comment.