Build a sample project that demonstrates every readiness signal

Direct answer

A concrete sample tree makes scanner documentation testable. This fixture creates one root README, one root LICENSE, and one test_*.py file under tests; each assertion names the path the scanner is expected to recognize. A new contributor can run the same fixture without borrowing files from an actual project.

The edge case is documentation that describes signals abstractly but never demonstrates their directory placement. A recursive implementation might accidentally accept a nested dependency README, while this fixture pins the intended locations.

The sample is not a complete project template. It does not compile Python, define a package, exercise a test runner, or claim that these files are sufficient for release. Its value is a small stable input for a filename-oriented scanner.

Complete example

from pathlib import Path
from tempfile import TemporaryDirectory

with TemporaryDirectory() as directory:
    root = Path(directory)
    (root / "README.md").write_text("guide", encoding="utf-8")
    (root / "LICENSE").write_text("text", encoding="utf-8")
    (root / "tests").mkdir()
    (root / "tests" / "test_api.py").write_text("", encoding="utf-8")
    assert (root / "README.md").is_file()
    assert (root / "LICENSE").is_file()
    assert (root / "tests" / "test_api.py").is_file()
    print("signals=readme,license,test-name")

Expected stdout:

signals=readme,license,test-name

Sources

- pathlib documentation

Prepared with AI assistance. The example uses synthetic data; its stated limits apply.

Comments

Popular posts from this blog

Compare Two Text Files in Python Without Modifying Them

Seven CSV Quality Checks to Run Before Importing Data

Explain why SQLite transactions cannot make an HTTP call atomic