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) diff --git a/src/build/util.py b/src/build/util.py index 96823b22..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 @@ -27,6 +27,8 @@ def _project_wheel_metadata(builder: ProjectBuilder) -> importlib_metadata.Packa def project_wheel_metadata( source_dir: PathType, isolated: bool = True, + *, + runner: RunnerType = pyproject_hooks.quiet_subprocess_runner, ) -> importlib_metadata.PackageMetadata: """ Return the wheel metadata for a project. @@ -38,6 +40,7 @@ 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 """ if isolated: @@ -45,7 +48,7 @@ def project_wheel_metadata( builder = ProjectBuilder.from_isolated_env( env, source_dir, - runner=pyproject_hooks.quiet_subprocess_runner, + runner=runner, ) env.install(builder.build_system_requires) env.install(builder.get_requires_for_build('wheel')) @@ -53,7 +56,7 @@ def project_wheel_metadata( else: builder = ProjectBuilder( source_dir, - runner=pyproject_hooks.quiet_subprocess_runner, + runner=runner, ) return _project_wheel_metadata(builder)