module documentation

Undocumented

Class Tag A representation of the tag triple for a wheel.
Function compatible_tags Yields the sequence of tags that are compatible with a specific version of Python.
Function cpython_tags Yields the tags for a CPython interpreter.
Function generic_tags Yields the tags for a generic interpreter.
Function interpreter_name Returns the name of the running interpreter.
Function interpreter_version Returns the version of the running interpreter.
Function mac_platforms Yields the platform tags for a macOS system.
Function parse_tag Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.
Function platform_tags Provides the platform tags for this installation.
Function sys_tags Returns the sequence of tag triples for the running interpreter.
Constant INTERPRETER_SHORT_NAMES Undocumented
Type Alias MacVersion Undocumented
Type Alias PythonVersion Undocumented
Variable logger Undocumented
Function _abi3_applies Determine if the Python version supports abi3.
Function _cpython_abis Undocumented
Function _generic_abi Return the ABI tag based on EXT_SUFFIX.
Function _generic_platforms Undocumented
Function _get_config_var Undocumented
Function _linux_platforms Undocumented
Function _mac_arch Undocumented
Function _mac_binary_formats Undocumented
Function _normalize_string Undocumented
Function _py_interpreter_range Yields Python versions in descending order.
Function _version_nodot Undocumented
Constant _32_BIT_INTERPRETER Undocumented
def compatible_tags(python_version: Optional[PythonVersion] = None, interpreter: Optional[str] = None, platforms: Optional[Iterable[str]] = None) -> Iterator[Tag]: (source)

Yields the sequence of tags that are compatible with a specific version of Python. The tags consist of: - py*-none-<platform> - <interpreter>-none-any # ... if `interpreter` is provided. - py*-none-any

def cpython_tags(python_version: Optional[PythonVersion] = None, abis: Optional[Iterable[str]] = None, platforms: Optional[Iterable[str]] = None, *, warn: bool = False) -> Iterator[Tag]: (source)

Yields the tags for a CPython interpreter. The tags consist of: - cp<python_version>-<abi>-<platform> - cp<python_version>-abi3-<platform> - cp<python_version>-none-<platform> - cp<less than python_version>-abi3-<platform> # Older Python versions down to 3.2. If python_version only specifies a major version then user-provided ABIs and the 'none' ABItag will be used. If 'abi3' or 'none' are specified in 'abis' then they will be yielded at their normal position and not at the beginning.

def generic_tags(interpreter: Optional[str] = None, abis: Optional[Iterable[str]] = None, platforms: Optional[Iterable[str]] = None, *, warn: bool = False) -> Iterator[Tag]: (source)

Yields the tags for a generic interpreter. The tags consist of: - <interpreter>-<abi>-<platform> The "none" ABI will be added if it was not explicitly provided.

def interpreter_name() -> str: (source)

Returns the name of the running interpreter. Some implementations have a reserved, two-letter abbreviation which will be returned when appropriate.

def interpreter_version(*, warn: bool = False) -> str: (source)

Returns the version of the running interpreter.

def mac_platforms(version: Optional[MacVersion] = None, arch: Optional[str] = None) -> Iterator[str]: (source)

Yields the platform tags for a macOS system. The `version` parameter is a two-item tuple specifying the macOS version to generate platform tags for. The `arch` parameter is the CPU architecture to generate platform tags for. Both parameters default to the appropriate value for the current system.

def parse_tag(tag: str) -> FrozenSet[Tag]: (source)

Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances. Returning a set is required due to the possibility that the tag is a compressed tag set.

def platform_tags() -> Iterator[str]: (source)

Provides the platform tags for this installation.

def sys_tags(*, warn: bool = False) -> Iterator[Tag]: (source)

Returns the sequence of tag triples for the running interpreter. The order of the sequence corresponds to priority order for the interpreter, from most to least important.

INTERPRETER_SHORT_NAMES: Dict[str, str] = (source)

Undocumented

Value
{'python': 'py',
 'cpython': 'cp',
 'pypy': 'pp',
 'ironpython': 'ip',
 'jython': 'jy'}
MacVersion = (source)

Undocumented

Value
Tuple[int, int]
PythonVersion = (source)

Undocumented

Value
Sequence[int]

Undocumented

def _abi3_applies(python_version: PythonVersion) -> bool: (source)

Determine if the Python version supports abi3. PEP 384 was first implemented in Python 3.2.

def _cpython_abis(py_version: PythonVersion, warn: bool = False) -> List[str]: (source)

Undocumented

def _generic_abi() -> List[str]: (source)

Return the ABI tag based on EXT_SUFFIX.

def _generic_platforms() -> Iterator[str]: (source)

Undocumented

def _get_config_var(name: str, warn: bool = False) -> Union[int, str, None]: (source)

Undocumented

def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]: (source)

Undocumented

def _mac_arch(arch: str, is_32bit: bool = _32_BIT_INTERPRETER) -> str: (source)

Undocumented

def _mac_binary_formats(version: MacVersion, cpu_arch: str) -> List[str]: (source)

Undocumented

def _normalize_string(string: str) -> str: (source)

Undocumented

def _py_interpreter_range(py_version: PythonVersion) -> Iterator[str]: (source)

Yields Python versions in descending order. After the latest version, the major-only version will be yielded, and then all previous versions of that major version.

def _version_nodot(version: PythonVersion) -> str: (source)

Undocumented

_32_BIT_INTERPRETER = (source)

Undocumented

Value
(sys.maxsize <= 2 ** 32)