unidep
unidep copied to clipboard
BUG: Add support for local package install from extras in local dependencies
Problem
Currently, when specifying a local dependency with extras in the local_dependencies section, like:
local_dependencies:
- ../my_package[extra1]
The pip install ./local/path part of the extras are ignored (the non-local deps are installed correctly). This means that optional dependencies defined in my_package under the extra1 section are not included.
Solution
This PR adds proper support for extras in local dependencies by:
- Extracting extras from paths in local_dependencies
- When processing a dependency with extras, looking up the optional dependencies from those extras
- Recursively following nested local dependencies that might be defined in optional dependency sections
- Properly handling wildcard extras (
*) to include all optional sections
Tests
Added several tests to verify the functionality:
- Basic test for local dependencies with extras
- Advanced test with nested extras chains
- Test for wildcard extras handling
The implementation maintains full backward compatibility and adds no changes to existing behavior.
📚 Documentation preview 📚: https://unidep--238.org.readthedocs.build/en/238/