-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error with pip requirement files and URL packages #43
Comments
|
I can duplicate this, looks like a bug to me.
|
If I drop that URL into a requirements file and run:
Pip downloads the source distribution and installs it. Is the desired result Unless pip verifies the link, shouldn't pip just include the URL as-is as part Is the goal to parse the URL, extract the distribution name and version, then
|
The follow changeset/patch allows the following to work:
Following the logic for how pip inspects each line in the incoming Link to changesethttps://bitbucket.org/khightower/pip/changeset/dd1551ceade0
|
Current behaviour:
At the moment |
@pypa does this seem like behaviour that should be fixed? |
@Ivoz my first impression is that it could be pretty hard to fix, as the original URL won't be recorded anywhere in the package metadata (I haven't checked this - correct me if I'm wrong). So a "proper" fix probably involves adding new package metadata somewhere to record this information. (Which probably implies it needs adding to the Metadata 2.0 spec). Assuming that's the case, and given that it's easy enough to manually add the URL to the requirements file, I don't think it's worth fixing. But I don't use freeze at all myself - how much of an issue is this in practice to people who rely on freeze? |
I had a half written PR to record where something was insalled from before, but as I reemmber it @pfmoore is correct in that once it's been installed we no longer have that information to completely recreate it. |
@pfmoore my initial impression is that at least we could keep the url in the |
btw, it's no longer true that we require as for this issue, I say close. technically, it's about an error that doesn't occur anymore. let the PR @dstuff reference be about the possibility of storing the URL for |
@Ivoz ah, I see - you're saying that if there's a URL currently in requirements.txt that matches up with an installed distribution, then use that unchanged rather than writing out the normal requirement. Yes that's possible, although it's arguably a behaviour change - this is what the help currently says for -r:
But that's a minor nitpick, really just a reminder to update the help if this gets implemented. Also, it does mean that I guess I'm happy if people who actually use the feature would find it of use. |
Basically the concerned use case would be that |
oh, when using
but when there is a fragment, no error, which is counter to what the issue reports. |
Alright, see #1690 |
When you put a URL in a requirements file, pip doesn't know what package it is dealing with, and tells you to add #egg=PackageName to the URL. However, even when this is done, it still doesn't parse out the package name and gives the same error.
To reproduce, put the following URL in a requirements.txt and run
pip freeze -r requirements.txt
:The text was updated successfully, but these errors were encountered: