Skip to content

Add a function to find what to install from a pylock.toml #1087

@brettcannon

Description

@brettcannon

Something like:

def select(
    lock: Pylock,
    *,
    environment: markers.Environment | None = None,
    tags: Sequence[tags.Tag] | None = None,
    groups: Collection[str] | None = None
) -> ...:
    """Select what to install from the lock file.

    The *environment* and *tags* parameters represent the environment being
    selected for. If unspecified, ``packaging.markers.default_environment()``
    and ``packaging.tags.sys_tags()`` are used.

    The *groups* parameter represents the groups to install. If unspecified,
    the default groups are used.
    """

There's no specified return type as I haven't thought that through yet as there needs to be a way to tell what sort of thing was selected (e.g. wheel or sdist; might just be isinstance) and a way to get attestation identities (might just require to get back to the appropriate entry in [[packages]] by returning a tuple of (thing, entry)).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions