fix: let pip install the dev extra

pyproject had no [build-system] and no module list, so setuptools' flat-layout discovery found scripts/ and tests/ and refused to build. Nothing is packaged now and pip install -e ".[dev]" installs the tooling.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 19:08:16 +01:00
1 parent fefc9ca16f
commit a1d5e7c13d
3 files changed
+42 -2

No files matched your search

+11
View File
@@ -1,3 +1,14 @@
# Installing the project installs its dependencies and nothing else:
# `pip install -e ".[dev]"` gives a contributor every tool the tests use.
# scripts/ and tests/ run from the checkout, so no package is built from them.
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = []
py-modules = []
[project]
name = "retrobios"
version = "1.0.0"
+28
View File
@@ -2725,6 +2725,34 @@ class DeclaredDependenciesMatchTheDocumentedWorkflows(unittest.TestCase):
)
class TheProjectInstallsWithPip(unittest.TestCase):
"""pyproject declared a dev extra that pip could not install: without a
[build-system] and an explicit module list, setuptools' flat-layout
discovery found scripts/ and tests/ and refused to build."""
def test_setuptools_discovers_nothing_to_package(self):
import importlib.util # noqa: PLC0415
if importlib.util.find_spec("setuptools") is None:
self.skipTest("setuptools is not installed")
program = (
"from setuptools.dist import Distribution\n"
"from setuptools.config.pyprojecttoml import apply_configuration\n"
"dist = apply_configuration(Distribution(), 'pyproject.toml')\n"
"dist.set_defaults()\n"
"print(sorted(dist.packages or []), sorted(dist.py_modules or []))\n"
)
done = subprocess.run([sys.executable, "-c", program], cwd=ROOT,
capture_output=True, text=True, check=False)
self.assertEqual(done.returncode, 0, done.stderr[-2000:])
self.assertEqual(done.stdout.strip(), "[] []")
import tomllib # noqa: PLC0415
with (ROOT / "pyproject.toml").open("rb") as handle:
build = tomllib.load(handle)["build-system"]
self.assertEqual(build["build-backend"], "setuptools.build_meta")
class ACheckThatCannotAnswerDoesNotPass(unittest.TestCase):
"""Exiting zero says the question was answered and the answer was yes.
+3 -2
View File
@@ -39,8 +39,9 @@ tests are reported as skipped, so install them before a pull request
(`pip install "jsonschema[format-nongpl]" markdown`). The installer's
full-screen tests drive `install.py --tui` on a pseudo-terminal and read the
screen back with `pyte`, and fuzz the key decoder with `hypothesis`: both skip
without them (`pip install pyte hypothesis`). No test framework beyond the
standard library `unittest` module.
without them (`pip install pyte hypothesis`). `pip install -e ".[dev]"` from the
checkout installs all of these at once, from the `dev` extra of `pyproject.toml`.
No test framework beyond the standard library `unittest` module.
## Modules at a glance