From 9194e8c5a35f404211f3d51ac2f2374969369bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Wed, 28 Aug 2024 09:57:48 -0600 Subject: [PATCH 1/3] Add a few intersphinx links to the Python Packaging User Guide --- docs/conf.py | 1 + docs/index.rst | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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:: From dec2863d5c046dde62d7b98f1ae22cad2c7725b7 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 4 Sep 2024 15:44:12 -0400 Subject: [PATCH 2/3] docs: fix forward reference --- src/build/_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/_types.py b/src/build/_types.py index ac363581..56014c9f 100644 --- a/src/build/_types.py +++ b/src/build/_types.py @@ -8,7 +8,7 @@ ConfigSettings = typing.Mapping[str, typing.Union[str, typing.Sequence[str]]] Distribution = typing.Literal['sdist', 'wheel', 'editable'] -StrPath = typing.Union[str, 'os.PathLike[str]'] +StrPath = 'typing.Union[str, os.PathLike[str]]' if typing.TYPE_CHECKING: from pyproject_hooks import SubprocessRunner From f2af676b4369adb101275600b7da34eea939be05 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 4 Sep 2024 16:19:39 -0400 Subject: [PATCH 3/3] Update _types.py --- src/build/_types.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/build/_types.py b/src/build/_types.py index 56014c9f..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