Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions mesonpy/_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
import struct
import sys
import sysconfig
import typing


if typing.TYPE_CHECKING: # pragma: no cover
from typing import Optional, Union


# https://peps.python.org/pep-0425/#python-tag
Expand All @@ -36,13 +31,6 @@ def get_interpreter_tag() -> str:
return f'{name}{version[0]}{version[1]}'


def _get_config_var(name: str, default: Union[str, int, None] = None) -> Union[str, int, None]:
value: Union[str, int, None] = sysconfig.get_config_var(name)
if value is None:
return default
return value


def get_abi_tag() -> str:
# The best solution to obtain the Python ABI is to parse the
# $SOABI or $EXT_SUFFIX sysconfig variables as defined in PEP-314.
Expand Down Expand Up @@ -175,7 +163,7 @@ def get_platform_tag() -> str:


class Tag:
def __init__(self, interpreter: Optional[str] = None, abi: Optional[str] = None, platform: Optional[str] = None):
def __init__(self, interpreter: str | None = None, abi: str | None = None, platform: str | None = None):
self.interpreter = interpreter or get_interpreter_tag()
self.abi = abi or get_abi_tag()
self.platform = platform or get_platform_tag()
Expand Down
Loading