-
Notifications
You must be signed in to change notification settings - Fork 56
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 and extra-index-url in wrong order #149
index-url and extra-index-url in wrong order #149
Comments
Sounds like a pip bug - I don't see any hint in https://pip.pypa.io/en/stable/reference/requirements-file-format/ that the order of these lines should matter. If you agree - and are sure that this is really the problem - suggest raising a bug with |
Agreed. I have lodged an issue on pip. I'll close this issue, and will re-open if |
I thought that this might have been fixed in Poetry 1.5.1 with the migration away from default/secondary, but it's not. I'm frustrated to see it's more of a pip problem, too. Our default repo, which we had set to |
If running the command
poetry export --format requirements.txt --output requirements.txt
with a poetry project that defines a default source as well as other sources, e.g.:The resulting
requirements.txt
has theindex-url
andextra-index-url
flags defined at the top of the file as such:This is intended behaviour, as can be seen in test case test_exporter_exports_requirements_txt_with_default_and_secondary_sources.
However, because the
extra-index-url
is specified beforeindex-url
, pip does not recognise it when running thepip install --user -r requirements.txt
. I can verify this because when I have a package in the secondary-pypi that's not in the primary-pypi, pip cannot find any versions of the package until I manually edit therequirements.txt
file to switch the order of the flags (i.e. havingindex-url
defined in the first line andextra-index-url
defined below that). Once I re-order the flags inrequirements.txt
pip installs the defined packages without issue.The text was updated successfully, but these errors were encountered: