-
Notifications
You must be signed in to change notification settings - Fork 3.1k
indicating package version of code within a tar #7443
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
Hello, I checked and also couldn't find any docs that support this usage. I'm hesitant to elevate this to the level of "supported", because of our intent to eventually deprecate the Alternatives that could work for your use case:
Also in case it saves some trouble, please note that relative paths in direct references are not implemented yet. |
@chrahunt I'm not sure I understand. Maybe it'd help to use my specific example. I have the following entry: It seems like PEP-508 would want it restructured into: But, that results in "ERROR: Invalid requirement" and "Hint: It looks like a path." (maybe due to that relative path?) Using what I have seems to work, but I'm just concerned about a newer version of pip breaking it. The fact that I can't find any documentation worries me. I managed to do this:
Everything looks okay except for that link as that would resolve to an absolute path. However, it seems to currently work in 19.3.1 despite that. |
Thanks for the examples, that helps!
This is expected, because versions are not allowed in direct references.
You are right to be concerned - if it is not documented then it is not technically supported and may change without notice (likely accidentally)! To your original post
I'm hesitant to consider this a documentation issue, since updating the documentation to include this means that it is supported and we may not want to do that. The reason is that we are intending to deprecate this syntax in favor of PEP 440 direct references, which do not support specifying the package version.
To satisfy your use case I do not think you need
and run
Please let me know if that is clear and works for you. |
I wasn't sure I totally understood the Thank you so much for the help! |
hmm.. I'm using |
|
There are a few quirks in |
@uranusjr - my understanding is that the RFC defining |
This is not a code bug but a possible documentation issue. I'm trying to include a local tar file in my requirements.txt. All the documentation I've read simply mentions adding "#egg=[project_name]" but when I do only that the package will fail to install an updated version. I stumbled upon doing "#egg=[project_name]==[version]" and that seems to compare the currently installed version with version specified and install if they don't match. It also seems to properly understand if the local one matches that version and does nothing in that case too. However, I can't seem to find any documentation stating this is an intended function so I'm leery to use it.
To clarify with an example:
my_project 1.0 is already installed and I have a tar containing 1.1 . My requirements.txt file has
my_project.tar.gz#egg=my_project
. Pip will say that 'my_project' is already installed and skip over it.If I change my requirements.txt to include
my_project.tar.gz#egg=my_project==1.1
, pip seems to then recognize that this version is different then the currently installed one and installs it. Also, subsequentpip install -r requirements.txt
properly skip over install as the currently installed version matches the one in the requirements.txt .The text was updated successfully, but these errors were encountered: