unidep icon indicating copy to clipboard operation
unidep copied to clipboard

BUG: Add support for local package install from extras in local dependencies

Open basnijholt opened this issue 8 months ago • 1 comments

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:

  1. Extracting extras from paths in local_dependencies
  2. When processing a dependency with extras, looking up the optional dependencies from those extras
  3. Recursively following nested local dependencies that might be defined in optional dependency sections
  4. Properly handling wildcard extras (*) to include all optional sections

Tests

Added several tests to verify the functionality:

  1. Basic test for local dependencies with extras
  2. Advanced test with nested extras chains
  3. 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/

basnijholt avatar Mar 07 '25 05:03 basnijholt