Skip to content

Commit

Permalink
deps: pep518: don't require wheel for default build system
Browse files Browse the repository at this point in the history
According to updated PEP518 specification:

> An example [build-system] table for a project built with setuptools is:
  ```toml
  [build-system]
  # Minimum requirements for the build system to execute.
  requires = ["setuptools"]
  ```
  Build tools are expected to use the example configuration file above
  as their default semantics when a pyproject.toml file is not present.

`wheel` is setuptools' PEP517 dependency (required to build a wheel).

See for details:
https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-build-system-dependencies-the-build-system-table

Fixes: #87
Signed-off-by: Stanislav Levin <[email protected]>
  • Loading branch information
stanislavlevin committed Nov 13, 2024
1 parent b1b354e commit c9288e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pyproject_installer/lib/build_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def parse_build_system_spec(srcdir):
pyproject_file = srcdir / "pyproject.toml"
default_build_system = {
"build-backend": "setuptools.build_meta:__legacy__",
"requires": ["setuptools", "wheel"],
"requires": ["setuptools"],
}

if not pyproject_file.is_file():
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_deps/test_collectors/test_pep518.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_pep518_collector_missing_pyproject_toml(
deps_command("sync", depsconfig_path, srcnames=[])

expected_conf = deepcopy(input_conf)
expected_conf["sources"][srcname]["deps"] = ["setuptools", "wheel"]
expected_conf["sources"][srcname]["deps"] = ["setuptools"]
actual_conf = json.loads(depsconfig_path.read_text(encoding="utf-8"))
assert actual_conf == expected_conf

Expand All @@ -63,7 +63,7 @@ def test_pep518_collector_missing_build_system(
deps_command("sync", depsconfig_path, srcnames=[])

expected_conf = deepcopy(input_conf)
expected_conf["sources"][srcname]["deps"] = ["setuptools", "wheel"]
expected_conf["sources"][srcname]["deps"] = ["setuptools"]
actual_conf = json.loads(depsconfig_path.read_text(encoding="utf-8"))
assert actual_conf == expected_conf

Expand Down

0 comments on commit c9288e7

Please sign in to comment.