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

Unable to redirect to a GCP Artifact Registry Python repository with pip #40

Open
miguelnmiranda opened this issue Dec 28, 2022 · 0 comments

Comments

@miguelnmiranda
Copy link

Related to #29

Description

When following redirects that don't point to one of the configured indexes pip will request credentials from the keyrings using the netloc taken from the target's location url (ref).

The present implementation relies on urlib.urlparse to determine hostname (which is part of netloc). urlparse requires urls to have a schema (or at least //) in order to detect a netloc (ref), which makes it misclassify a previously parsed netloc as a path (ref).

I proposed falling back to using the service as is when a hostname cannot be found (ex. when service is just a url's netloc).

Example

Using a private pypi server that redirects to a GCP Artifact Registry Python repository for certain dependencies.

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

No branches or pull requests

1 participant