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

Respect pip config #24

Closed
pawamoy opened this issue Mar 2, 2021 · 4 comments
Closed

Respect pip config #24

pawamoy opened this issue Mar 2, 2021 · 4 comments

Comments

@pawamoy
Copy link
Contributor

pawamoy commented Mar 2, 2021

Following #5, I'm working in a corporate environment and we use a private pypi mirror. Would it be possible for pip-download to respect pip's config so I don't have to manually specify the index-url on the command line?

Or maybe I can configure this in pip-download JSON configuration file?

Also, thank you very much for this tool, it is highly convenient!!

@youngquan
Copy link
Owner

Got it! How about this priorities:pip's config which have been configured > the time zone > pypi.org?I also think the way using the time zone to pick the pypi index should be optimized or be removed. Do you have some idea?

@pawamoy
Copy link
Contributor Author

pawamoy commented Mar 5, 2021

Thans for the quick answer 🙂

For the priority, I'd say:

  1. pip's config (if it exists and index-url is set)
  2. time zone
  3. pypi.org

I personally never needed another public mirror than pypi.org, so I can't say if the time-zone-based approach is good or not, I'll let you decide!

For reference, here's my pip config file:

[global]
trusted-host = our-private-index.domain.com
index-url = https://username:[email protected]/index/simple/
cert = /home/user/certs/ca-bundle.crt

Not sure what internals you are using, and therefore if you could just read index-url (note the credentials in it for basic auth) or would have to read the rest as well, like trusted-host and cert.

Let me know if I can be of any help 🙂 (I could send a PR of course but I'm not sure when I'll have the time to do so!)

@di
Copy link

di commented Mar 10, 2021

This is probably blocked on di/pip-api#44.

@pawamoy
Copy link
Contributor Author

pawamoy commented May 13, 2021

In the end I'll close this because it's very easy to set up an alias with the right index. Feel free to reopen if you think it is still an interesting feature!

@pawamoy pawamoy closed this as completed May 13, 2021
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

3 participants