Skip to content

Conversation

@basnijholt
Copy link
Owner

@basnijholt basnijholt commented Sep 11, 2025

Closes #257.


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

basnijholt and others added 9 commits September 10, 2025 16:45
- Add pip_indices field to ParsedRequirements and CondaEnvironmentSpec
- Parse pip_indices from both requirements.yaml and pyproject.toml
- Support environment variable expansion for credentials ( syntax)
- Map pip_indices to pip_repositories in environment.yaml for conda-lock
- Implement --index-url (primary) and --extra-index-url (supplementary) flags
- Add comprehensive unit tests and integration tests
- Support both pip and uv backends with same index flag interface
- Maintain backward compatibility (empty list default)
- Preserve index order (first is primary, rest are supplementary)
- Fix file handle usage with Path.open() instead of open()
- Add type annotations to test methods and fixtures
- Comment out unused test variables
- Add type annotation for empty list initialization
- Fix unused mock_monorepo argument
- Remove commented-out code (ERA001) from test_pip_indices.py and test_pip_indices_integration.py
- Add missing pip_indices argument to create_conda_env_specification calls
- Fix type annotations: use list[str] instead of list[Platform] with type ignores where needed
- Add __future__ annotations import and update typing imports
- Fix unused arguments with noqa comments
- Consolidate nested with statements
- Mark hardcoded test password with noqa comment
- Clean up indentation issues

All pre-commit hooks now pass: ruff, ruff-format, and mypy
- Add pip_indices to the list of supported configuration keys
- Include examples in both requirements.yaml and pyproject.toml formats
- Create dedicated "Custom Pip Index URLs" section with:
  - Clear explanation of use cases (private packages, mirrors, authenticated repos)
  - How it works (primary vs extra indices, env var expansion, deduplication)
  - Practical examples for common scenarios (GitLab, Artifactory, PyTorch)
  - Generated environment.yaml output format
  - Security best practices for credentials
- Update table of contents to include new section
- Reference Conda CEP-8 specification for pip_repositories field

The documentation provides clear guidance for users needing to access
private or alternative package repositories while maintaining security
best practices.
- Change _pip_install to _pip_install_local (the actual function name)
- Change generate_conda_lock to conda_lock_command (the actual function name)

This fixes the CI test failures caused by attempting to mock non-existent functions.
- Test _build_pip_index_arguments function with various scenarios
- Test environment variable expansion in pip indices
- Test pip and uv command construction with indices
- Test install command with pip_indices
- Test conda environment file generation with pip_repositories
- Test full workflow integration from parsing to environment generation
- Add edge case tests for missing environment variables
- Test conda-lock integration with pip_indices
- Changed back from list[str] to list[Platform]
- Removed unnecessary # type: ignore[arg-type] comments
- Added proper import of Platform from unidep.platform_definitions

This corrects a mistake where I incorrectly changed the type annotations
to work around an import issue instead of fixing the import properly.
The pip_repositories field is not part of any official Conda Enhancement Proposal (CEP).
CEP-8 (PR #8 in conda/ceps) is actually about menuinst multiplatform support, not pip repositories.

The pip_repositories field appears to be an unofficial extension that may be used
by conda-lock or other tools, but it's not a formal specification.
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.

pip-repositories support

2 participants