unidep.platform_definitions module#

unidep - Unified Conda and Pip requirements management.

Types and definitions for platforms, selectors, and markers.

class unidep.platform_definitions.Spec(name: str, which: CondaPip, pin: str | None = None, identifier: str | None = None, selector: str | None = None)[source]#

Bases: NamedTuple

A dependency specification.

identifier: Optional[str]#

Alias for field number 3

name: str#

Alias for field number 0

name_with_pin(*, is_pip=False)[source]#

Return the name with the pin.

Return type:

str

pin: Optional[str]#

Alias for field number 2

platforms()[source]#

Return the platforms for this dependency.

Return type:

Optional[list[Literal['linux-64', 'linux-aarch64', 'linux-ppc64le', 'osx-64', 'osx-arm64', 'win-64']]]

pprint()[source]#

Pretty print the dependency.

Return type:

str

selector: Optional[str]#

Alias for field number 4

which: Literal['conda', 'pip']#

Alias for field number 1

unidep.platform_definitions.platforms_from_selector(selector)[source]#

Extract platforms from a selector.

For example, selector can be 'linux64 win64' or 'osx'.

Return type:

list[Literal['linux-64', 'linux-aarch64', 'linux-ppc64le', 'osx-64', 'osx-arm64', 'win-64']]

unidep.platform_definitions.validate_selector(selector)[source]#

Check if a selector is valid.

Return type:

None