Skip to content

Conversation

@basnijholt
Copy link
Owner

@basnijholt basnijholt commented Mar 7, 2025

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/

@codecov
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.10%. Comparing base (608ab3c) to head (86f5412).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
+ Coverage   97.04%   97.10%   +0.06%     
==========================================
  Files          10       10              
  Lines        1454     1486      +32     
==========================================
+ Hits         1411     1443      +32     
  Misses         43       43              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@basnijholt basnijholt changed the title BUG: Fix nested local optional deps BUG: Add support for extras in local dependencies Mar 8, 2025
@basnijholt basnijholt changed the title BUG: Add support for extras in local dependencies BUG: Add support for local package install from extras in local dependencies Mar 8, 2025
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.

2 participants