Skip to content

feat: support extra-index-url for pip-repositories#280

Open
guenp wants to merge 4 commits intobasnijholt:mainfrom
guenp:feature/pip-repositories
Open

feat: support extra-index-url for pip-repositories#280
guenp wants to merge 4 commits intobasnijholt:mainfrom
guenp:feature/pip-repositories

Conversation

@guenp
Copy link
Copy Markdown

@guenp guenp commented Mar 17, 2026

Summary

  • Adds 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; duplicates from multiple requirements files are deduplicated

Motivation

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-repositories field in environment.yaml, but unidep merge doesn'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:

extra-index-url: https://us-east4-python.pkg.dev/myproject/myrepo/simple/
dependencies:
  - pip: my-private-package

Generated environment.yaml:

pip-repositories:
  - https://us-east4-python.pkg.dev/myproject/myrepo/simple/
dependencies:
  - pip:
    - my-private-package

Test plan

  • Verify unidep merge generates pip-repositories in environment.yaml when extra-index-url is set
  • Verify single string and list formats both work
  • Verify unidep conda-lock passes the field through to tmp.environment.yaml
  • Verify conda-lock can resolve packages from the private registry

📚 Documentation preview 📚: https://unidep--280.org.readthedocs.build/en/280/

guenp and others added 4 commits March 17, 2026 08:48
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.
NamedTuple fields with mutable defaults trigger RUF012. Use tuple
instead of list for the pip_repositories default values.
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

Successfully merging this pull request may close these issues.

1 participant