-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Order of installation sources is undocumented #3299
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
Comments
Agreed this isn't immediately obvious. However, if you think about it, what you're asking pip to do is to install a requirement In theory there is a choice to be made if the local filesystem and PyPI have the same version - but it shouldn't actually matter then which pip chooses - as the version is identical, the result should be the same either way (and with the caches involved, it's not even obvious that the local filesystem is faster...) But it would certainly be useful to document this a bit more clearly - I went hunting for a while before I realised what I said above. Maybe some explanation at https://pip.pypa.io/en/stable/reference/pip_install/#finding-packages would be worthwhile? Would you be interested in suggesting some text (either as a PR, or if you prefer just here and I'll turn it into a PR)? |
Thinking some more, my suggestion for some text would be:
Comments? |
Thanks for the quick reaction and the explaination. You see, even though I am experienced with many packaging tools, it was not at all clear to me that pip considers the various sources in parallel. I would have rather expected that it first looks locally, and only if there's nothing there, in the index. I think your text is very good. Just one comment: I find that currently it is also not very clear that --no-index disables PyPI. Perhaps one could add behind the first mention of PyPI: (if it has not been disabled via |
OK, I've created #3300. I'll let Travis check I didn't make any stupid typos, then commit it. Thanks for the suggestion! |
#3300 looks good. I realize, however, that some subtle issues are still not clear (at least to me). I believe that these things should be cristal clear just from reading the documentation, please bear with me. So But then, what if the directory If I say One more in the same spirit: Say I download one of the wheels for Gevent from http://www.lfd.uci.edu/~gohlke/pythonlibs/#gevent, but I forget to download its dependency |
The directory that is examined is actually
I see why you might be having trouble understanding all the implications here, but I think it's because you are misunderstanding fundamental concepts (what is a package, what is a requirement...) that we shouldn't be explaining in detail in the install page, but should be made clear somewhere in the manual (I don't know if they are, I haven't checked).
You're right in your understanding of the Gevent case. I think I'll merge the update I made, but beyond that I'm not sure what (or how much) extra needs changing. A PR clarifying some of the points would be welcome, but we should remember that this is a manual page, not a tutorial, and it's reasonable to assume some familiarity with the underlying concepts and principles of packaging (explanations of which are in the realm of the packaging user guide). |
Thanks again for the explanation. I agree of course that reference documentation should not be a tutorial, but then reference documentation should strive to completely specify the behavior while remaining terse. Please do go ahead merging your PR. Consider the following comments as inspiration for another "issue" that I believe should be opened regarding pip documentation. It is true that I have very little experience with pip, but I do have considerable experience with packaging Python software: I did the (rather complex) packaging of https://pypi.python.org/pypi/kwant/ for example. If after reading the output of I think a lot could be gained by adding (to the "Description" section of I couldn't find any documentation that states that pip searches the current directory for packages like you say. I believe this should be mentioned at a prominent place. Does this for example mean that if the current directory contains packages that are dependencies of the one that one is trying to install, these dependencies might be installed from that source? If this is indeed the case this should be made clear somehow. Above, you say that a directory "foo" cannot contain a python package "bla". Where is this explained in the docs? To my knowledge the name of a Python package is defined as the I noted that PEP 427 specifies a naming scheme for wheel files. So, pip enforces this scheme, i.e. it's valid to execute Usage: Description: |
Thanks for the suggestions. I see where you're coming from - the problem we have is that most of the people developing pip are a bit too close to the problem to know what's difficult to understand. We have people working on the "what does a beginner need to know" side of the question (there is work going on with the PUG in that area) but "people experienced with Python packaging but not with pip" is a different (and possibly much bigger) group of users that we haven't really addressed, so your feedback is really helpful. I agree with your suggestion on having a description of what each of the things in "Usage" does. I'll see if I can write some words around that. Rethinking your search path question in the context of your suggestion that we need to define what each of the forms in the "usage" section does, makes me realise that my original explanation (and hence, some of the details in my PR) was wrong. The problem is that once we take a step back, your question about the search path doesn't actually make sense - there isn't really a single search path. The thing is, But in the case of So my previous explanation (and my PR) was wrong. I'll need to make a new PR that clarifies - I'll do so by basing it on your suggestion of explaining each of the Regarding your point on the naming scheme for wheel files. I'm still not 100% sure what you're getting at here. As you say, PEP 427 specifies a naming scheme for wheels. But it's not so much that pip enforces that scheme, as that pip expects it. You suggest renaming Maybe when saying what
How does that sound? |
Don't forget that |
Thanks. It's awfully easy to miss important details like this when trying to summarise. Which is why review of any changes here is so important (and also why I'm reluctant to go into too much detail - I'm definitely not familiar with all the nuances here so I'm likely to miss things). |
... although rereading the manpage, that would be an instance of |
@pfmoore, your text sounds good to me. I'm available to review the PR. |
@cgroth Thanks, I haven't forgotten this, but I've been a bit busy the last week or so. I'll ping when I have a PR ready. |
@cgroth I'm just getting back to this - sorry for the delay. I've created PR #3366 that covers the following points:
Let me know what you think |
Looks good to me, thanks a lot! |
Closing as the need seems to have been addressed. Comment/reopen if needed. |
It seems that current pip documentation does not specify whether the command
will install the package "hello" from PyPI, or from the local path "hello", if both exist. I believe that this aspect of pip deserves to be documented well.
The text was updated successfully, but these errors were encountered: