feat: support extra-index-url for pip-repositories#280
Open
guenp wants to merge 4 commits intobasnijholt:mainfrom
Open
feat: support extra-index-url for pip-repositories#280guenp wants to merge 4 commits intobasnijholt:mainfrom
guenp wants to merge 4 commits intobasnijholt:mainfrom
Conversation
Add support for an `extra-index-url` field in `requirements.yaml` that gets translated to `pip-repositories` in the generated `environment.yaml`. This allows conda-lock to resolve pip packages from private registries (e.g., Google Artifact Registry) without manual post-processing. The field accepts a single URL string or a list of URLs. Duplicate URLs from multiple requirements files are deduplicated.
for more information, see https://pre-commit.ci
NamedTuple fields with mutable defaults trigger RUF012. Use tuple instead of list for the pip_repositories default values.
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extra-index-urlfield inrequirements.yamlthat gets translated topip-repositoriesin the generatedenvironment.yamlconda-lockto resolve pip packages from private registries (e.g., Google Artifact Registry) without manual post-processingMotivation
When using private Python package registries alongside conda-lock, there's no way to specify extra pip indexes through unidep. conda-lock supports a
pip-repositoriesfield inenvironment.yaml, butunidep mergedoesn't generate it.This is needed when internal packages are published to a private registry (e.g., Google Artifact Registry) and need to be resolved by conda-lock's PyPI solver.
Example
requirements.yaml:Generated
environment.yaml:Test plan
unidep mergegeneratespip-repositoriesinenvironment.yamlwhenextra-index-urlis setunidep conda-lockpasses the field through totmp.environment.yaml📚 Documentation preview 📚: https://unidep--280.org.readthedocs.build/en/280/