pyproject-api 1.11.3__tar.gz → 1.11.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.pre-commit-config.yaml +2 -2
  2. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/PKG-INFO +1 -1
  3. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/_version.py +2 -2
  4. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/_via_fresh_subprocess.py +1 -0
  5. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/test_frontend.py +60 -20
  6. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.github/FUNDING.yaml +0 -0
  7. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.github/SECURITY.md +0 -0
  8. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.github/dependabot.yaml +0 -0
  9. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.github/release.yaml +0 -0
  10. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.github/workflows/check.yaml +0 -0
  11. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.github/workflows/release.yaml +0 -0
  12. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.gitignore +0 -0
  13. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/.readthedocs.yml +0 -0
  14. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/CODE_OF_CONDUCT.md +0 -0
  15. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/LICENSE +0 -0
  16. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/README.md +0 -0
  17. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/docs/api.rst +0 -0
  18. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/docs/conf.py +0 -0
  19. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/docs/index.rst +0 -0
  20. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/pyproject.toml +0 -0
  21. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/__init__.py +0 -0
  22. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/__main__.py +0 -0
  23. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/_backend.py +0 -0
  24. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/_backend.pyi +0 -0
  25. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/_frontend.py +0 -0
  26. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/_util.py +0 -0
  27. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/src/pyproject_api/py.typed +0 -0
  28. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/_build_sdist.py +0 -0
  29. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/demo_pkg_inline/build.py +0 -0
  30. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/demo_pkg_inline/pyproject.toml +0 -0
  31. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/test_backend.py +0 -0
  32. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/test_frontend_setuptools.py +0 -0
  33. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/test_main.py +0 -0
  34. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/test_util.py +0 -0
  35. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tests/test_version.py +0 -0
  36. {pyproject_api-1.11.3 → pyproject_api-1.11.4}/tox.toml +0 -0
@@ -15,11 +15,11 @@ repos:
15
15
  - id: codespell
16
16
  additional_dependencies: ["tomli>=2.4.1"]
17
17
  - repo: https://github.com/tox-dev/tox-toml-fmt
18
- rev: "v1.10.3"
18
+ rev: "v1.11.0"
19
19
  hooks:
20
20
  - id: tox-toml-fmt
21
21
  - repo: https://github.com/tox-dev/pyproject-fmt
22
- rev: "v2.29.4"
22
+ rev: "v2.30.1"
23
23
  hooks:
24
24
  - id: pyproject-fmt
25
25
  - repo: https://github.com/astral-sh/ruff-pre-commit
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyproject-api
3
- Version: 1.11.3
3
+ Version: 1.11.4
4
4
  Summary: API to interact with the python pyproject.toml based projects
5
5
  Project-URL: Changelog, https://github.com/tox-dev/pyproject-api/releases
6
6
  Project-URL: Homepage, https://pyproject-api.readthedocs.io
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.11.3'
22
- __version_tuple__ = version_tuple = (1, 11, 3)
21
+ __version__ = version = '1.11.4'
22
+ __version_tuple__ = version_tuple = (1, 11, 4)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -73,6 +73,7 @@ class SubprocessFrontend(Frontend):
73
73
  stderr=PIPE,
74
74
  stdin=PIPE,
75
75
  universal_newlines=True,
76
+ errors="backslashreplace",
76
77
  cwd=self._root,
77
78
  env=env,
78
79
  )
@@ -42,8 +42,45 @@ def test_missing_backend(local_builder: Callable[[str], Path]) -> None:
42
42
  assert "ModuleNotFoundError: No module named " in exc.err
43
43
 
44
44
 
45
- @pytest.mark.parametrize(("stream", "output"), [("stdout", "out"), ("stderr", "err")])
46
- def test_large_command_with_backend_output(stream: str, output: str, local_builder: Callable[[str], Path]) -> None:
45
+ @pytest.fixture
46
+ def isolated_build_wheel() -> Callable[[Path, str, int], tuple[str, str]]:
47
+ script = dedent("""
48
+ import sys
49
+ from pathlib import Path
50
+ from pyproject_api import SubprocessFrontend
51
+
52
+ root = Path(sys.argv[1])
53
+ frontend = SubprocessFrontend(*SubprocessFrontend.create_args_from_folder(root)[:-1])
54
+ result = frontend.build_wheel(root / "dist", config_settings={"payload": "y" * int(sys.argv[3])})
55
+ print(result.wheel.name)
56
+ print(getattr(result, sys.argv[2]), end="")
57
+ """)
58
+
59
+ def _f(root: Path, output: str, payload_size: int) -> tuple[str, str]:
60
+ # Run the frontend in a child process so a hang fails on the timeout instead of stalling pytest.
61
+ result = subprocess.run(
62
+ [sys.executable, "-X", "utf8", "-c", script, str(root), output, str(payload_size)],
63
+ capture_output=True,
64
+ encoding="utf-8",
65
+ timeout=30,
66
+ check=True,
67
+ )
68
+ assert not result.stderr
69
+ wheel, captured = result.stdout.split("\n", 1)
70
+ return wheel, captured
71
+
72
+ return _f
73
+
74
+
75
+ @pytest.mark.parametrize(
76
+ ("stream", "output"), [pytest.param("stdout", "out", id="stdout"), pytest.param("stderr", "err", id="stderr")]
77
+ )
78
+ def test_large_command_with_backend_output(
79
+ stream: str,
80
+ output: str,
81
+ local_builder: Callable[[str], Path],
82
+ isolated_build_wheel: Callable[[Path, str, int], tuple[str, str]],
83
+ ) -> None:
47
84
  tmp_path = local_builder(f"""
48
85
  import sys
49
86
 
@@ -54,27 +91,30 @@ def test_large_command_with_backend_output(stream: str, output: str, local_build
54
91
  assert config_settings == {{"payload": "y" * 1048576}}
55
92
  return "demo-1.0-py3-none-any.whl"
56
93
  """)
57
- # Isolate the frontend so a pipe deadlock fails with a timeout instead of hanging pytest.
58
- script = dedent("""
94
+ wheel, captured = isolated_build_wheel(tmp_path, output, 1048576)
95
+ assert (wheel, "x" * 1048576 in captured) == ("demo-1.0-py3-none-any.whl", True)
96
+
97
+
98
+ @pytest.mark.parametrize(
99
+ ("stream", "output"), [pytest.param("stdout", "out", id="stdout"), pytest.param("stderr", "err", id="stderr")]
100
+ )
101
+ def test_backend_output_with_invalid_bytes(
102
+ stream: str,
103
+ output: str,
104
+ local_builder: Callable[[str], Path],
105
+ isolated_build_wheel: Callable[[Path, str, int], tuple[str, str]],
106
+ ) -> None:
107
+ tmp_path = local_builder(f"""
59
108
  import sys
60
- from pathlib import Path
61
- from pyproject_api import SubprocessFrontend
62
109
 
63
- root = Path(sys.argv[1])
64
- frontend = SubprocessFrontend(*SubprocessFrontend.create_args_from_folder(root)[:-1])
65
- result = frontend.build_wheel(root / "dist", config_settings={"payload": "y" * 1048576})
66
- print(result.wheel.name)
67
- print("x" * 1048576 in getattr(result, sys.argv[2]))
110
+ sys.{stream}.buffer.write(b"before\\xffafter")
111
+ sys.{stream}.flush()
112
+
113
+ def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
114
+ return "demo-1.0-py3-none-any.whl"
68
115
  """)
69
- result = subprocess.run(
70
- [sys.executable, "-c", script, str(tmp_path), output],
71
- capture_output=True,
72
- text=True,
73
- timeout=30,
74
- check=True,
75
- )
76
- assert result.stdout.splitlines() == ["demo-1.0-py3-none-any.whl", "True"]
77
- assert not result.stderr
116
+ wheel, captured = isolated_build_wheel(tmp_path, output, 0)
117
+ assert (wheel, "before\\xffafter" in captured) == ("demo-1.0-py3-none-any.whl", True)
78
118
 
79
119
 
80
120
  def test_large_command_with_failed_backend(local_builder: Callable[[str], Path]) -> None:
File without changes
File without changes
File without changes