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

Use index-url in /etc/pip.conf #4050

Closed
WqyJh opened this issue Dec 7, 2019 · 4 comments
Closed

Use index-url in /etc/pip.conf #4050

WqyJh opened this issue Dec 7, 2019 · 4 comments
Assignees
Labels
triage Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@WqyJh
Copy link

WqyJh commented Dec 7, 2019

Hello, everyone! I don't know why not use index-url defined in /etc/pip.conf.

Currently, pipenv use source.url in Pipfile and a runtime option --pypi-mirror to specify the pypi index page. In my mind, this is not a smart design.

First of all, why should any body write the url in their source code. If someone is working on an opensource project and he use his closest mirror site and write the url in the source code. Other people have to modify the url first to run his code. If he is an developer, his Pipfile and Pipfile.lock would be changed, should he include this change in the SCM? For his convenience, he should include this change. But when he open pull requests to upstream, it's hard to process.

Second, using --pypi-mirror to specify mirror, which is really annoying. Developers from different place would have different command line. Imagine, every time they want to use pipenv, they have to type the --pypi-mirror option with a long url. It's really bad experience. What's more, developers usually have their /etc/pip.conf configuration since they start to play with python, but they still have to type that long url already defined in /etc/pip.conf. For some automation tool, they have to modify all command line relative with pipenv add that annoying option.

As far as I'm concerened, the /etc/pip.conf is the best design to specify the pypi mirror. Which is

  • Non-intrusive: no need to hardcoded in source code, no need to type for every command
  • Compatible with pip: painless for pip user to migrate
  • Humanity: makes people happy using pipenv
@matteius
Copy link
Member

Would need to consider the current behavior of pipenv==2022.8.19 with regards to index restricted packages being required to explcitly define package indexes in the Pipfile or use the default. Another thing is if you are using a mirror right now, you are going to have a longer locking phase because only the pypi URL checks for the json package API for pre-fetching the package hash information.

@matteius matteius added the Type: Enhancement 💡 This is a feature or enhancement request. label Aug 22, 2022
@matteius
Copy link
Member

Started working on this, but it needs more work: #5297

@matteius matteius self-assigned this Sep 13, 2022
@matteius
Copy link
Member

@WqyJh Would you be willing to test if this PR which is up to date with main and passing, which reads the pip.conf or `pip.ini? I still need to write documentation for it but I could use some help validating that it does what is expected, and if there are any config values that are ignored: #5297

@matteius
Copy link
Member

pipenv==2023.2.18 has been released with support for this feature enabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

2 participants