Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a --group option for installing from [dependency-groups] found in pyproject.toml in the current working directory #13065

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Commits on Nov 1, 2024

  1. Add 'dependency-groups==1.3.0' to vendored libs

    Steps taken:
    - add `dependency-groups==1.3.0` to vendor.txt
    - add dependency-groups to vendor __init__.py
    - run vendoring sync
    - examine results to confirm apparent correctness (rewritten tomli
      imports)
    sirosen committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    505b59a View commit details
    Browse the repository at this point in the history
  2. Implement Dependency Group option: --group

    `--group` is supported on `download` and `install` commands.
    The option is parsed into the more verbose and explicit
    `dependency_groups` name on the parsed args.
    
    Both of these commands invoke the same processor for resolving
    dependency groups, which loads `pyproject.toml` and resolves the list
    of provided groups against the `[dependency-groups]` table.
    
    A small alteration is made to `pip wheel` to initialize
    `dependency_groups = []`, as this allows for some lower-level
    consistency in the handling of the commands.
    sirosen committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    38aec3a View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Add unit tests for dependency group loading

    A new unit test module is added for parsing dependency groups and used
    to verify all of the pip-defined behaviors for handling
    dependency-groups.
    
    In one path, the underlying exception message from `dependency-groups`
    is exposed to users, where it should offer some explanation of why
    parsing failed, and this is therefore tested.
    
    Some related changes are applied to the dependency groups usage sites
    in the src tree. The signature of the dependency group requirement
    parse function is simplified, and its usage is therefore updated.
    A bugfix is applied to add a missing `f` on an intended f-string.
    sirosen committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    164e731 View commit details
    Browse the repository at this point in the history
  2. Add initial functional tests for dependency-groups

    This initial suite of tests is modeled fairly closely on existing
    tests for requirements files.
    
    Tests cover the following cases:
    - installing an empty dependency group (and nothing else)
    - installing from a simple / straightforward group
    - installing from multiple groups in a single command
    - normalizing names from the CLI and pyproject.toml to match
    - applying a constraints file to a dependency-group install
    sirosen committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    1d80247 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    282f69e View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2024

  1. Support --group on pip wheel

    Per review, support on `pip wheel` is desirable. This is net-net
    simpler, since we don't need any trickery to "dodge" the fact that it
    is a `RequirementCommand` but wasn't supporting `--group`.
    
    The desire to *not* support `--group` here was based on a mistaken
    idea about what `pip wheel` does.
    sirosen committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    6238f2c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9dbdabb View commit details
    Browse the repository at this point in the history