pyproject-api 1.11.4__tar.gz → 1.11.6__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.4 → pyproject_api-1.11.6}/.github/workflows/check.yaml +3 -3
  2. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.github/workflows/release.yaml +2 -1
  3. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.pre-commit-config.yaml +5 -4
  4. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.readthedocs.yml +1 -1
  5. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/PKG-INFO +2 -4
  6. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/pyproject.toml +24 -26
  7. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/__main__.py +1 -1
  8. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/_frontend.py +19 -6
  9. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/_version.py +2 -2
  10. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/test_frontend.py +31 -0
  11. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/test_frontend_setuptools.py +1 -2
  12. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/test_main.py +34 -2
  13. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tox.toml +5 -1
  14. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.github/FUNDING.yaml +0 -0
  15. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.github/SECURITY.md +0 -0
  16. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.github/dependabot.yaml +0 -0
  17. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.github/release.yaml +0 -0
  18. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/.gitignore +0 -0
  19. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/CODE_OF_CONDUCT.md +0 -0
  20. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/LICENSE +0 -0
  21. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/README.md +0 -0
  22. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/docs/api.rst +0 -0
  23. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/docs/conf.py +0 -0
  24. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/docs/index.rst +0 -0
  25. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/__init__.py +0 -0
  26. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/_backend.py +0 -0
  27. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/_backend.pyi +0 -0
  28. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/_util.py +0 -0
  29. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/_via_fresh_subprocess.py +0 -0
  30. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/src/pyproject_api/py.typed +0 -0
  31. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/_build_sdist.py +0 -0
  32. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/demo_pkg_inline/build.py +0 -0
  33. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/demo_pkg_inline/pyproject.toml +0 -0
  34. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/test_backend.py +0 -0
  35. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/test_util.py +0 -0
  36. {pyproject_api-1.11.4 → pyproject_api-1.11.6}/tests/test_version.py +0 -0
@@ -29,7 +29,6 @@ jobs:
29
29
  - "3.13"
30
30
  - "3.12"
31
31
  - "3.11"
32
- - "3.10"
33
32
  - type
34
33
  - dev
35
34
  - pkg_meta
@@ -49,6 +48,7 @@ jobs:
49
48
  - name: Install the latest version of uv
50
49
  uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
51
50
  with:
51
+ python-version: "3.15"
52
52
  enable-cache: false
53
53
  cache-dependency-glob: "pyproject.toml"
54
54
  github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -57,9 +57,9 @@ jobs:
57
57
  shell: bash
58
58
  run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
59
59
  - name: Install tox
60
- run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv
60
+ run: uv tool install --python-preference only-managed --python 3.15 tox --with tox-uv
61
61
  - name: Install Python
62
- if: startsWith(matrix.env, '3.') && matrix.env != '3.14'
62
+ if: startsWith(matrix.env, '3.') && matrix.env != '3.15'
63
63
  run: uv python install --python-preference only-managed ${{ matrix.env }}
64
64
  - name: Setup test suite
65
65
  run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
@@ -20,11 +20,12 @@ jobs:
20
20
  - name: Install the latest version of uv
21
21
  uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
22
22
  with:
23
+ python-version: "3.15"
23
24
  enable-cache: false
24
25
  cache-dependency-glob: "pyproject.toml"
25
26
  github-token: ${{ secrets.GITHUB_TOKEN }}
26
27
  - name: Build package
27
- run: uv build --python 3.14 --python-preference only-managed --sdist --wheel . --out-dir dist
28
+ run: uv build --python 3.15 --python-preference only-managed --sdist --wheel . --out-dir dist
28
29
  - name: Store the distribution packages
29
30
  uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
30
31
  with:
@@ -1,3 +1,5 @@
1
+ default_language_version:
2
+ python: python3.15
1
3
  repos:
2
4
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
5
  rev: v6.0.0
@@ -13,17 +15,16 @@ repos:
13
15
  rev: v2.4.3
14
16
  hooks:
15
17
  - id: codespell
16
- additional_dependencies: ["tomli>=2.4.1"]
17
18
  - repo: https://github.com/tox-dev/tox-toml-fmt
18
- rev: "v1.11.0"
19
+ rev: "v1.11.1"
19
20
  hooks:
20
21
  - id: tox-toml-fmt
21
22
  - repo: https://github.com/tox-dev/pyproject-fmt
22
- rev: "v2.30.1"
23
+ rev: "v2.30.3"
23
24
  hooks:
24
25
  - id: pyproject-fmt
25
26
  - repo: https://github.com/astral-sh/ruff-pre-commit
26
- rev: "v0.16.10"
27
+ rev: "v0.17.0"
27
28
  hooks:
28
29
  - id: ruff-format
29
30
  - id: ruff
@@ -4,5 +4,5 @@ build:
4
4
  tools: {}
5
5
  commands:
6
6
  - curl -LsSf https://astral.sh/uv/install.sh | sh
7
- - ~/.local/bin/uv tool install tox --with tox-uv -p 3.14 --managed-python
7
+ - ~/.local/bin/uv tool install tox --with tox-uv -p 3.15 --managed-python
8
8
  - ~/.local/bin/tox run -e docs --
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pyproject-api
3
- Version: 1.11.4
3
+ Version: 1.11.6
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
@@ -19,7 +19,6 @@ Classifier: Operating System :: MacOS :: MacOS X
19
19
  Classifier: Operating System :: Microsoft :: Windows
20
20
  Classifier: Operating System :: POSIX
21
21
  Classifier: Programming Language :: Python :: 3 :: Only
22
- Classifier: Programming Language :: Python :: 3.10
23
22
  Classifier: Programming Language :: Python :: 3.11
24
23
  Classifier: Programming Language :: Python :: 3.12
25
24
  Classifier: Programming Language :: Python :: 3.13
@@ -28,9 +27,8 @@ Classifier: Programming Language :: Python :: 3.15
28
27
  Classifier: Topic :: Software Development :: Libraries
29
28
  Classifier: Topic :: Software Development :: Testing
30
29
  Classifier: Topic :: Utilities
31
- Requires-Python: >=3.10
30
+ Requires-Python: >=3.11
32
31
  Requires-Dist: packaging>=26.3
33
- Requires-Dist: tomli>=2.4.1; python_version < '3.11'
34
32
  Description-Content-Type: text/markdown
35
33
 
36
34
  # [`pyproject-api`][RTD]
@@ -23,7 +23,7 @@ maintainers = [
23
23
  authors = [
24
24
  { name = "Bernát Gábor", email = "gaborjbernat@gmail.com" },
25
25
  ]
26
- requires-python = ">=3.10"
26
+ requires-python = ">=3.11"
27
27
  classifiers = [
28
28
  "Development Status :: 5 - Production/Stable",
29
29
  "Framework :: tox",
@@ -33,7 +33,6 @@ classifiers = [
33
33
  "Operating System :: Microsoft :: Windows",
34
34
  "Operating System :: POSIX",
35
35
  "Programming Language :: Python :: 3 :: Only",
36
- "Programming Language :: Python :: 3.10",
37
36
  "Programming Language :: Python :: 3.11",
38
37
  "Programming Language :: Python :: 3.12",
39
38
  "Programming Language :: Python :: 3.13",
@@ -48,7 +47,6 @@ dynamic = [
48
47
  ]
49
48
  dependencies = [
50
49
  "packaging>=26.3",
51
- "tomli>=2.4.1; python_version<'3.11'",
52
50
  ]
53
51
  urls.Changelog = "https://github.com/tox-dev/pyproject-api/releases"
54
52
  urls.Homepage = "https://pyproject-api.readthedocs.io"
@@ -102,36 +100,36 @@ lint.select = [
102
100
  "ALL",
103
101
  ]
104
102
  lint.ignore = [
105
- "ANN401", # Dynamically typed expressions
106
- "COM812", # Conflict with formatter
107
- "CPY", # No copyright statements
108
- "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
109
- "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
110
- "DOC", # no restructuredtext support
111
- "INP001", # no implicit namespaces here
112
- "ISC001", # Conflict with formatter
113
- "S104", # Possible binding to all interface
103
+ "any-type", # Dynamically typed expressions
104
+ "CPY", # No copyright statements
105
+ "DOC", # no restructuredtext support
106
+ "hardcoded-bind-all-interfaces", # Possible binding to all interface
107
+ "implicit-namespace-package", # no implicit namespaces here
108
+ "incorrect-blank-line-before-class", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
109
+ "missing-trailing-comma", # Conflict with formatter
110
+ "multi-line-summary-first-line", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
111
+ "single-line-implicit-string-concatenation", # Conflict with formatter
114
112
  ]
115
113
  lint.per-file-ignores."src/pyproject_api/_backend.py" = [
116
114
  "ANN",
117
- "I002",
118
- "T201",
115
+ "missing-required-import",
116
+ "print",
119
117
  "UP",
120
118
  ]
121
119
  lint.per-file-ignores."src/pyproject_api/_backend.pyi" = [
122
- "E301",
123
- "E302",
120
+ "blank-line-between-methods",
121
+ "blank-lines-top-level",
124
122
  ]
125
123
  lint.per-file-ignores."tests/**/*.py" = [
126
- "D", # don't care about documentation in tests
127
- "FBT", # don't care about booleans as positional arguments in tests
128
- "INP001", # no implicit namespace
129
- "PLC2701", # private imports
130
- "PLR0913", # too many positional arguments
131
- "PLR0917", # too many positional arguments
132
- "PLR2004", # Magic value used in comparison, consider replacing with a constant variable
133
- "S101", # asserts allowed in tests
134
- "S603", # `subprocess` call: check for execution of untrusted input
124
+ "assert", # asserts allowed in tests
125
+ "D", # don't care about documentation in tests
126
+ "FBT", # don't care about booleans as positional arguments in tests
127
+ "implicit-namespace-package", # no implicit namespace
128
+ "import-private-name", # private imports
129
+ "magic-value-comparison", # Magic value used in comparison, consider replacing with a constant variable
130
+ "subprocess-without-shell-equals-true", # `subprocess` call: check for execution of untrusted input
131
+ "too-many-arguments", # too many positional arguments
132
+ "too-many-positional-arguments", # too many positional arguments
135
133
  ]
136
134
  lint.isort = { known-first-party = [
137
135
  "pyproject_api",
@@ -149,7 +147,7 @@ count = true
149
147
  max_supported_python = "3.15"
150
148
 
151
149
  [tool.ty]
152
- environment.python-version = "3.14"
150
+ environment.python-version = "3.15"
153
151
 
154
152
  [tool.coverage]
155
153
  run.parallel = true
@@ -65,7 +65,7 @@ def main(argv: list[str]) -> None: # ruff:ignore[undocumented-public-function]
65
65
  parser = main_parser()
66
66
  args = parser.parse_args(argv)
67
67
 
68
- outdir = args.outdir or args.srcdir / "dist"
68
+ outdir = (args.outdir or args.srcdir / "dist").absolute()
69
69
  # we intentionally do not build editable distributions by default
70
70
  distributions = args.distributions or ["sdist", "wheel"]
71
71
 
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
6
- import sys
6
+ import tomllib
7
7
  from abc import ABC, abstractmethod
8
8
  from contextlib import contextmanager
9
9
  from pathlib import Path
@@ -19,10 +19,6 @@ from pyproject_api._util import ensure_empty_dir
19
19
  if TYPE_CHECKING:
20
20
  from collections.abc import Generator, Iterator
21
21
 
22
- if sys.version_info >= (3, 11): # pragma: no cover (py311+)
23
- import tomllib
24
- else: # pragma: no cover (py311+)
25
- import tomli as tomllib
26
22
 
27
23
  _HERE = Path(__file__).parent
28
24
  ConfigSettings = dict[str, Any] | None
@@ -223,6 +219,7 @@ class Frontend(ABC):
223
219
 
224
220
  frontend = Frontend(*Frontend.create_args_from_folder(project_folder))
225
221
  """
222
+ folder = folder.absolute()
226
223
  py_project_toml = folder / "pyproject.toml"
227
224
  if py_project_toml.exists():
228
225
  with py_project_toml.open("rb") as file_handler:
@@ -346,7 +343,7 @@ class Frontend(ABC):
346
343
  return MetadataForBuildWheelResult(metadata_directory / basename, out, err)
347
344
 
348
345
  def _check_metadata_dir(self, metadata_directory: Path) -> None:
349
- if metadata_directory == self._root:
346
+ if metadata_directory.resolve() == self._root.resolve():
350
347
  msg = f"the project root and the metadata directory can't be the same {self._root}"
351
348
  raise RuntimeError(msg)
352
349
  if metadata_directory.exists(): # start with fresh
@@ -540,3 +537,19 @@ def _str_list(build_system: dict[str, Any], key: str) -> list[str]:
540
537
  msg = f"build-system.{key} must be a list of strings, got {value!r}"
541
538
  raise ValueError(msg)
542
539
  return value
540
+
541
+
542
+ __all__ = [
543
+ "BackendFailed",
544
+ "CmdStatus",
545
+ "EditableResult",
546
+ "Frontend",
547
+ "MetadataForBuildEditableResult",
548
+ "MetadataForBuildWheelResult",
549
+ "OptionalHooks",
550
+ "RequiresBuildEditableResult",
551
+ "RequiresBuildSdistResult",
552
+ "RequiresBuildWheelResult",
553
+ "SdistResult",
554
+ "WheelResult",
555
+ ]
@@ -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.4'
22
- __version_tuple__ = version_tuple = (1, 11, 4)
21
+ __version__ = version = '1.11.6'
22
+ __version_tuple__ = version_tuple = (1, 11, 6)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -42,6 +42,37 @@ 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
+ def test_relative_project_folder(local_builder: Callable[[str], Path], monkeypatch: pytest.MonkeyPatch) -> None:
46
+ root = local_builder("""
47
+ def get_requires_for_build_wheel(config_settings=None):
48
+ return ["wheel"]
49
+ """)
50
+ monkeypatch.chdir(root.parent)
51
+ frontend = SubprocessFrontend(*SubprocessFrontend.create_args_from_folder(Path(root.name))[:-1])
52
+
53
+ assert frontend.get_requires_for_build_wheel().requires == (Requirement("wheel"),)
54
+
55
+
56
+ @pytest.mark.parametrize(
57
+ "hook",
58
+ [
59
+ pytest.param("prepare_metadata_for_build_wheel", id="wheel"),
60
+ pytest.param("prepare_metadata_for_build_editable", id="editable"),
61
+ ],
62
+ )
63
+ def test_relative_project_folder_rejects_root_as_metadata_directory(
64
+ hook: str, local_builder: Callable[[str], Path], monkeypatch: pytest.MonkeyPatch
65
+ ) -> None:
66
+ root = local_builder("")
67
+ monkeypatch.chdir(root.parent)
68
+ frontend = SubprocessFrontend(*SubprocessFrontend.create_args_from_folder(Path(root.name))[:-1])
69
+
70
+ with pytest.raises(RuntimeError, match="the project root and the metadata directory can't be the same"):
71
+ getattr(frontend, hook)(Path(root.name))
72
+
73
+ assert {path.name for path in root.iterdir()} == {"pyproject.toml", "build_tester.py"}
74
+
75
+
45
76
  @pytest.fixture
46
77
  def isolated_build_wheel() -> Callable[[Path, str, int], tuple[str, str]]:
47
78
  script = dedent("""
@@ -124,8 +124,7 @@ def test_setuptools_exception(frontend_setuptools: SubprocessFrontend) -> None:
124
124
  assert isinstance(context.value.out, str)
125
125
  assert isinstance(context.value.err, str)
126
126
  assert context.value.exc_type == "TypeError"
127
- prefix = "_BuildMetaBackend." if sys.version_info >= (3, 10) else ""
128
- msg = f"{prefix}build_wheel() missing 1 required positional argument: 'wheel_directory'"
127
+ msg = "_BuildMetaBackend.build_wheel() missing 1 required positional argument: 'wheel_directory'"
129
128
  assert context.value.exc_msg == msg
130
129
  assert context.value.code == 1
131
130
  assert context.value.args == ()
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from pathlib import Path
4
+ from shutil import copytree
4
5
  from typing import TYPE_CHECKING
5
6
 
6
7
  import pytest
@@ -12,6 +13,37 @@ if TYPE_CHECKING:
12
13
  import pytest_mock
13
14
 
14
15
 
16
+ @pytest.mark.parametrize(
17
+ ("distribution", "filename"),
18
+ [
19
+ pytest.param("--sdist", "demo_pkg_inline-1.0.0.tar.gz", id="sdist"),
20
+ pytest.param("--wheel", "demo_pkg_inline-1.0.0-py3-none-any.whl", id="wheel"),
21
+ pytest.param("--editable", "demo_pkg_inline-1.0.0-py3-none-any.whl", id="editable"),
22
+ ],
23
+ )
24
+ @pytest.mark.parametrize(
25
+ ("outdir_args", "outdir"),
26
+ [
27
+ pytest.param([], "project/dist", id="default-outdir"),
28
+ pytest.param(["--outdir", "artifacts"], "artifacts", id="relative-outdir"),
29
+ ],
30
+ )
31
+ def test_cli_build_relative_to_caller(
32
+ tmp_path: Path,
33
+ monkeypatch: pytest.MonkeyPatch,
34
+ distribution: str,
35
+ filename: str,
36
+ outdir_args: list[str],
37
+ outdir: str,
38
+ ) -> None:
39
+ copytree(Path(__file__).parent / "demo_pkg_inline", tmp_path / "project")
40
+ monkeypatch.chdir(tmp_path)
41
+
42
+ pyproject_api.__main__.main(["project", distribution, *outdir_args])
43
+
44
+ assert (tmp_path / outdir / filename).is_file()
45
+
46
+
15
47
  @pytest.mark.parametrize(
16
48
  ("cli_args", "srcdir", "outdir", "hooks"),
17
49
  [
@@ -24,13 +56,13 @@ if TYPE_CHECKING:
24
56
  (
25
57
  ["src"],
26
58
  Path("src"),
27
- Path("src") / "dist",
59
+ Path("src").absolute() / "dist",
28
60
  ["build_sdist", "build_wheel"],
29
61
  ),
30
62
  (
31
63
  ["-o", "out"],
32
64
  Path.cwd(),
33
- Path("out"),
65
+ Path("out").absolute(),
34
66
  ["build_sdist", "build_wheel"],
35
67
  ),
36
68
  (
@@ -1,9 +1,10 @@
1
1
  requires = [ "tox>=4.64.7", "tox-uv>=1.36.1" ]
2
- env_list = [ "3.15", "3.14", "3.13", "3.12", "3.11", "3.10", "3.15t", "docs", "fix", "pkg_meta", "type" ]
2
+ env_list = [ "3.15", "3.14", "3.13", "3.12", "3.11", "3.15t", "docs", "fix", "pkg_meta", "type" ]
3
3
  skip_missing_interpreters = true
4
4
 
5
5
  [env_run_base]
6
6
  description = "run the unit tests with pytest under {env_name}"
7
+ default_base_python = [ "3.15" ]
7
8
  package = "wheel"
8
9
  wheel_build_env = ".pkg"
9
10
  dependency_groups = [ "test" ]
@@ -35,6 +36,9 @@ commands = [
35
36
  ],
36
37
  ]
37
38
 
39
+ [env_pkg_base]
40
+ default_base_python = [ "3.15" ]
41
+
38
42
  [env.docs]
39
43
  description = "build documentation"
40
44
  dependency_groups = [ "docs" ]
File without changes
File without changes