From 8052319bf4cd3c67b75cef282c32190455c15b2c Mon Sep 17 00:00:00 2001 From: q0w <43147888+q0w@users.noreply.github.com> Date: Sun, 22 Jan 2023 13:10:56 +0300 Subject: [PATCH 1/5] Allow passing alternative runner to `project_wheel_metadata` --- src/build/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/build/util.py b/src/build/util.py index 90c00281..52e9bf8b 100644 --- a/src/build/util.py +++ b/src/build/util.py @@ -28,6 +28,7 @@ def _project_wheel_metadata(builder: build.ProjectBuilder) -> importlib_metadata def project_wheel_metadata( srcdir: build.PathType, isolated: bool = True, + runner: build.RunnerType = pyproject_hooks.quiet_subprocess_runner, ) -> importlib_metadata.PackageMetadata: """ Return the wheel metadata for a project. @@ -39,10 +40,11 @@ def project_wheel_metadata( :param isolated: Whether or not to run invoke the backend in the current environment or to create an isolated one and invoke it there. + :param runner: An alternative runner for backend subprocesses """ builder = build.ProjectBuilder( os.fspath(srcdir), - runner=pyproject_hooks.quiet_subprocess_runner, + runner=runner, ) if not isolated: From f60f4ea70dfac3054c53cf1b870ce458fc535769 Mon Sep 17 00:00:00 2001 From: q0w <43147888+q0w@users.noreply.github.com> Date: Tue, 24 Jan 2023 02:11:04 +0300 Subject: [PATCH 2/5] Update src/build/util.py Co-authored-by: Henry Schreiner --- src/build/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build/util.py b/src/build/util.py index 52e9bf8b..af2dad96 100644 --- a/src/build/util.py +++ b/src/build/util.py @@ -28,6 +28,7 @@ def _project_wheel_metadata(builder: build.ProjectBuilder) -> importlib_metadata def project_wheel_metadata( srcdir: build.PathType, isolated: bool = True, + *, runner: build.RunnerType = pyproject_hooks.quiet_subprocess_runner, ) -> importlib_metadata.PackageMetadata: """ From a5acd3b5a38d6ebbbc08705bf8931311ec739a74 Mon Sep 17 00:00:00 2001 From: layday Date: Wed, 25 Jan 2023 22:15:21 +0200 Subject: [PATCH 3/5] Fix annotation --- src/build/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/util.py b/src/build/util.py index 62f80c27..beb5738b 100644 --- a/src/build/util.py +++ b/src/build/util.py @@ -28,7 +28,7 @@ def project_wheel_metadata( source_dir: PathType, isolated: bool = True, *, - runner: build.RunnerType = pyproject_hooks.quiet_subprocess_runner, + runner: RunnerType = pyproject_hooks.quiet_subprocess_runner, ) -> importlib_metadata.PackageMetadata: """ Return the wheel metadata for a project. From f7828183e361ef94e00743c04fbbbc19e15d43bc Mon Sep 17 00:00:00 2001 From: layday Date: Wed, 25 Jan 2023 22:16:35 +0200 Subject: [PATCH 4/5] Add changelog entry --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 360fd97f..24f1159e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,8 @@ Changelog Unreleased ========== +- Added ``runner`` parameter to ``util.project_wheel_metadata`` + (`PR #566`_, Fixes `#553`_) - Modified ``ProjectBuilder`` constructor signature, added alternative ``ProjectBuilder.from_env`` constructor, redefined ``env.IsolatedEnv`` interface, and exposed ``env.DefaultIsolatedEnv``, @@ -15,7 +17,9 @@ Unreleased from an ``IsolatedEnv`` in a consistent manner. Mutating the project builder is no longer supported. (`PR #537`_) +.. _#553: https://github.com/pypa/build/issues/553 .. _PR #537: https://github.com/pypa/build/pull/537 +.. _PR #566: https://github.com/pypa/build/pull/566 0.10.0 (2023-01-11) From c9c97581f33b1c2f66f710c51bca9b1337b5013c Mon Sep 17 00:00:00 2001 From: layday Date: Wed, 25 Jan 2023 22:17:23 +0200 Subject: [PATCH 5/5] Add missing import --- src/build/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/util.py b/src/build/util.py index beb5738b..9f0570ee 100644 --- a/src/build/util.py +++ b/src/build/util.py @@ -8,7 +8,7 @@ import pyproject_hooks -from . import PathType, ProjectBuilder +from . import PathType, ProjectBuilder, RunnerType from .env import DefaultIsolatedEnv