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

index-url option help misleading #705

Closed
dinio31 opened this issue Jan 3, 2019 · 3 comments
Closed

index-url option help misleading #705

dinio31 opened this issue Jan 3, 2019 · 3 comments

Comments

@dinio31
Copy link

dinio31 commented Jan 3, 2019

Help message describing pip-compile index-url option does not seem compliant with the expected behavior if I refer to #208: the default could be different of PyPI in that case.

Am I right?

@atugushev
Copy link
Member

atugushev commented Jan 15, 2019

As i can see it works like a charm.

Here's the list index_urls:
https:/jazzband/pip-tools/blob/master/piptools/repositories/pypi.py#L53-L55

Let's assume user did non pass --index-url, so first element pip_options.index_url would contain a value provided by pip. Pip provides a value from pip.conf or default PyPI.simple_url.

Could you write a test to demonstrate your assumption?

@dinio31
Copy link
Author

dinio31 commented Jan 16, 2019

Thanks for your answer. Probably I was not clear enough: I was speaking of the help message which is misleading when there is a custom pip configuration.

>pip-compile --help
Usage: pip-compile [OPTIONS] [SRC_FILES]...

  Compiles requirements.txt from requirements.in specs.

Options:
...
  -i, --index-url TEXT            Change index URL (defaults to PyPI)

(defaults to PyPI) is hardcoded:
https:/jazzband/pip-tools/blob/master/piptools/scripts/compile.py#L39

In the case where a pip.ini or pip.conf file is provided to pip (at the root of a virtualenv for instance), this message is wrong.

This message could be: (defaults to PyPI except if you specified an 'index-url' field in pip configuration), or something like that. But it is a bit long.
A better option would be to dynamically provide the true default coming from pip configuration. I have dug into the code but did not find a simple way to do it. Using pip.index.PackageFinder (as done in PyPIRepository class) should certainly do the job, but I cannot figure out how to call it prior to all the Click stuff.

@atugushev
Copy link
Member

atugushev commented Jan 17, 2019

Got your point. I'm not sure it's worth it. Anyways, the description could be rephrased.

@atugushev atugushev added the PR wanted Feature is discussed or bug is confirmed, PR needed label Jan 25, 2019
@atugushev atugushev removed the PR wanted Feature is discussed or bug is confirmed, PR needed label Feb 20, 2019
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

2 participants