Skip to content

Commit

Permalink
Merge branch 'main' into optional-uv
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored Sep 4, 2024
2 parents ab9acba + 7df70fc commit 04ba5ae
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/reusable-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- macos
- windows
py:
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
- "pypy3.8"
- "pypy3.9-v7.3.14"
- "pypy3.10-v7.3.17"
- "3.12"
- "3.11"
- "3.10"
Expand All @@ -30,7 +30,7 @@ jobs:
continue-on-error: >- # jobs not required in branch protection
${{
(
startsWith(matrix.py, 'pypy-')
startsWith(matrix.py, 'pypy')
&& matrix.os == 'windows'
)
&& true
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ enable_error_code = ["ignore-without-code", "truthy-bool", "redundant-expr"]
[[tool.mypy.overrides]]
module = [
"colorama", # Optional dependency
"pyproject_hooks.*", # Untyped
"virtualenv", # Optional dependency
]
ignore_missing_imports = true
Expand Down
4 changes: 3 additions & 1 deletion src/build/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ def _parse_build_system_table(pyproject_toml: Mapping[str, Any]) -> Mapping[str,


def _wrap_subprocess_runner(runner: SubprocessRunner, env: env.IsolatedEnv) -> SubprocessRunner:
def _invoke_wrapped_runner(cmd: Sequence[str], cwd: str | None, extra_environ: Mapping[str, str] | None) -> None:
def _invoke_wrapped_runner(
cmd: Sequence[str], cwd: str | None = None, extra_environ: Mapping[str, str] | None = None
) -> None:
runner(cmd, cwd, {**(env.make_extra_environ() or {}), **(extra_environ or {})})

return _invoke_wrapped_runner
Expand Down
12 changes: 9 additions & 3 deletions src/build/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
import typing


__all__ = ['ConfigSettings', 'Distribution', 'StrPath', 'SubprocessRunner']

ConfigSettings = typing.Mapping[str, typing.Union[str, typing.Sequence[str]]]
Distribution = typing.Literal['sdist', 'wheel', 'editable']
StrPath = typing.Union[str, 'os.PathLike[str]']
SubprocessRunner = typing.Callable[
[typing.Sequence[str], typing.Optional[str], typing.Optional[typing.Mapping[str, str]]], None
]

if typing.TYPE_CHECKING:
from pyproject_hooks import SubprocessRunner
else:
SubprocessRunner = typing.Callable[
[typing.Sequence[str], typing.Optional[str], typing.Optional[typing.Mapping[str, str]]], None
]
2 changes: 1 addition & 1 deletion tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_venv_creation(
pytest.param(
'uv',
marks=[
pytest.mark.xfail(IS_PYPY and IS_WINDOWS, reason='uv cannot find PyPy executable'),
IS_PYPY and IS_WINDOWS and sys.version_info < (3, 9), reason='uv cannot find PyPy 3.8 executable on Windows'
pytest.mark.skipif(MISSING_UV, reason='uv executable not found'),
]
),
Expand Down
6 changes: 1 addition & 5 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
'* Installing packages in isolated environment:',
' - setuptools >= 42.0.0',
'* Getting build dependencies for wheel...',
'* Installing packages in isolated environment:',
' - wheel',
'* Building wheel...',
'Successfully built test_setuptools-1.0.0.tar.gz and test_setuptools-1.0.0-py2.py3-none-any.whl',
],
Expand All @@ -273,8 +271,6 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
'* Installing packages in isolated environment:',
' - setuptools >= 42.0.0',
'* Getting build dependencies for wheel...',
'* Installing packages in isolated environment:',
' - wheel',
'* Building wheel...',
'Successfully built test_setuptools-1.0.0-py2.py3-none-any.whl',
],
Expand Down Expand Up @@ -316,7 +312,7 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
def test_output(package_test_setuptools, tmp_dir, capsys, args, output):
build.__main__.main([package_test_setuptools, '-o', tmp_dir, *args])
stdout, stderr = capsys.readouterr()
assert stdout.splitlines() == output
assert set(stdout.splitlines()) <= set(output)


@pytest.mark.pypy3323bug
Expand Down

0 comments on commit 04ba5ae

Please sign in to comment.