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

Generate requirement.lock may put --index-url line after --extra-index-url line, cause pip install -r requirement.lock ignore extra index url #1012

Open
zedongh opened this issue Apr 12, 2024 · 0 comments

Comments

@zedongh
Copy link

zedongh commented Apr 12, 2024

Steps to Reproduce

Here are a open issue for pypi --extra-index-url ignored if before --index-url in requirements.txt show why order of extra-index-url and index-url matters now.

[[tool.rye.sources]]
name = "pypi"
url = "https://mirrors.ustc.edu.cn/pypi/web/simple"

will cause requirement.lock

--extra-index-url https://mirrors.ustc.edu.cn/pypi/web/simple
--index-url https://pypi.org/pypi

and a temporay solution is declare default on the top of toml

[[tool.rye.sources]]
name = "default"
url = "https://pypi.org/pypi"

[[tool.rye.sources]]
name = "pypi"
url = "https://mirrors.ustc.edu.cn/pypi/web/simple"

will cause requirement.lock

--index-url https://pypi.org/pypi
--extra-index-url https://mirrors.ustc.edu.cn/pypi/web/simple

Expected Result

For compatiable should always put --index-url line before --extra-index-url in generated requirement.lock and requirement-dev.lock

Actual Result

--index-url line after --extra-index-url line if not declare top default source override

Version Info

0.32.0

Stacktrace

not necessary

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

1 participant