diff --git a/docs/conf.py b/docs/conf.py index ebdd217a..46caa97c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,6 +40,7 @@ intersphinx_mapping = { 'python': ('https://docs.python.org/3/', None), + 'packaging': ('https://packaging.python.org/en/latest/', None), } # Add any paths that contain templates here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index ac222f39..1ce74d96 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,10 +4,11 @@ build ***** -A simple, correct Python packaging build frontend. +A simple, correct Python packaging :std:term:`build frontend `. build manages ``pyproject.toml``-based builds, invoking -build-backend hooks as appropriate to build a distribution package. +:std:term:`build-backend ` hooks as appropriate to build a +:std:term:`distribution package `. It is a simple build tool and does not perform any dependency management. .. sphinx_argparse_cli:: diff --git a/src/build/_types.py b/src/build/_types.py index ac363581..8d7bdd8a 100644 --- a/src/build/_types.py +++ b/src/build/_types.py @@ -1,6 +1,7 @@ from __future__ import annotations import os +import sys import typing @@ -8,7 +9,11 @@ ConfigSettings = typing.Mapping[str, typing.Union[str, typing.Sequence[str]]] Distribution = typing.Literal['sdist', 'wheel', 'editable'] -StrPath = typing.Union[str, 'os.PathLike[str]'] + +if typing.TYPE_CHECKING or sys.version_info > (3, 9): + StrPath = typing.Union[str, os.PathLike[str]] +else: + StrPath = typing.Union[str, os.PathLike] if typing.TYPE_CHECKING: from pyproject_hooks import SubprocessRunner