Skip to content

Conversation

@basnijholt
Copy link
Owner

@basnijholt basnijholt commented Sep 22, 2025

This implementation follows the principle of 'Let UniDep translate, let Pixi resolve'. Instead of pre-resolving conflicts ourselves, we simply translate requirements.yaml and pyproject.toml files to pixi.toml format and let Pixi handle all dependency resolution.

Key changes:

  • Add minimal _pixi.py module (~180 lines) for simple pixi.toml generation
  • Add --pixi flag to merge command to generate pixi.toml instead of environment.yaml
  • Support both single file and monorepo configurations with Pixi features
  • Add comprehensive tests for pixi.toml generation
  • Document implementation plan in PIXI_PLAN.md

This approach is much simpler than the previous implementation (~500+ lines) that tracked dependency origins and attempted to resolve conflicts ourselves.


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

This implementation follows the principle of 'Let UniDep translate, let Pixi resolve'.
Instead of pre-resolving conflicts ourselves, we simply translate requirements.yaml
and pyproject.toml files to pixi.toml format and let Pixi handle all dependency
resolution.

Key changes:
- Add minimal _pixi.py module (~180 lines) for simple pixi.toml generation
- Add --pixi flag to merge command to generate pixi.toml instead of environment.yaml
- Support both single file and monorepo configurations with Pixi features
- Add comprehensive tests for pixi.toml generation
- Document implementation plan in PIXI_PLAN.md

This approach is much simpler than the previous implementation (~500+ lines)
that tracked dependency origins and attempted to resolve conflicts ourselves.
Pixi doesn't allow spaces in version specifiers like '>= 1.11'.
This fix normalizes all version strings by removing spaces,
converting '>= 1.11' to '>=1.11'.

Also added test case to verify this normalization works correctly.
When generating pixi.toml files, UniDep now automatically detects
local pip-installable packages (those with setup.py or pyproject.toml
with [build-system]) and adds them as editable dependencies.

This allows Pixi to install the local packages in development mode,
similar to 'pip install -e .'.

Changes:
- Use is_pip_installable() to detect local packages
- Add local packages as editable dependencies in pypi-dependencies
- For single packages: use path='.'
- For monorepos: use path='./feature_name' for each feature
- Add test to verify local package detection and inclusion
basnijholt and others added 3 commits September 22, 2025 17:37
…cies

When adding local packages to pixi.toml, extract the actual package
name from the [project].name field in pyproject.toml rather than using
the directory name. This ensures the package name matches what pip/pixi
expects.

For example, if pyproject.toml has name='ionq.analysis', we now use
'ionq_analysis' (normalized) instead of 'analysis' (directory name).

This fixes issues where Pixi couldn't find the local packages because
the names didn't match.
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