Skip to content

Support parsing --find-links, --index-url, and --extra-index-url in requirements.txt#1146

Merged
charliermarsh merged 3 commits intomainfrom
charlie/index-url
Jan 29, 2024
Merged

Support parsing --find-links, --index-url, and --extra-index-url in requirements.txt#1146
charliermarsh merged 3 commits intomainfrom
charlie/index-url

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Jan 27, 2024

Summary

This PR adds support for --find-links, --index-url, and --extra-index-url arguments when specified in a requirements.txt.

It's a mostly-straightforward change. The only uncertain piece is what to do when multiple files include these flags, and/or when we include them on the CLI and in other files.

In general:

  • If anything specifies --no-index, we respect it.
  • We combine all --extra-index-url and --find-links across all sources, since those are just vectors.
  • If we see multiple --index-url in requirements files, we error.
  • We respect the --index-url from the command line over any provided in a requirements file.

(pip-compile seems to just pick one semi-arbitrarily when multiple are provided.)

Closes #1143.

@charliermarsh charliermarsh marked this pull request as ready for review January 27, 2024 03:35
@charliermarsh charliermarsh force-pushed the charlie/index-url branch 5 times, most recently from 04fe9d3 to 8c4c819 Compare January 27, 2024 04:17
@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Jan 28, 2024
Comment thread crates/requirements-txt/src/lib.rs
@charliermarsh charliermarsh force-pushed the charlie/index-url branch 2 times, most recently from c90d880 to 9603348 Compare January 29, 2024 14:34
@charliermarsh charliermarsh force-pushed the charlie/index-url branch 2 times, most recently from d9f54e7 to d98350c Compare January 29, 2024 14:53
@charliermarsh charliermarsh enabled auto-merge (squash) January 29, 2024 14:53
@charliermarsh charliermarsh merged commit 67a0964 into main Jan 29, 2024
@charliermarsh charliermarsh deleted the charlie/index-url branch January 29, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support parsing --find-links, --index-url, and --extra-index-url from requirements.txt

2 participants