0%

A Project Someone Else Can Run · practice

Prove a Clean Rebuild

A handoff is stronger when it survives a clean root. Follow the / README commands in this internal-network session. Install from the reviewed mirror, run the fake-HTTP tests, and show help. Do not make the real API call.

python3 -m venv .venv
./.venv/bin/python -m pip install -r requirements-dev.txt
./.venv/bin/python -m pytest -q
./.venv/bin/python api_catalog.py --help

Then copy only the six authored files into a new disposable folder under /workspace whose name contains a space and non-ASCII text. This location supports the native libraries installed in a ; the site’s /tmp mount does not.

mktemp -d creates a unique folder, so an existing learner folder is never reused. A shell is a name that stores text: proof_dir=... stores the path, $(...) supplies the output of the enclosed command, and $proof_dir reads it back. The quotes preserve spaces. Copy the named files only, create a new environment inside the copy, and repeat the checks. Do not copy an existing .venv or recursively copy /workspace into its own child.

proof_dir=$(mktemp -d "/workspace/Fresh Café Project.XXXXXX")
mkdir "$proof_dir/tests"
cp API_CONTRACT.md README.md api_catalog.py requirements.txt requirements-dev.txt "$proof_dir/"
cp tests/test_api_catalog.py "$proof_dir/tests/"
cd "$proof_dir"
python3 -m venv .venv
./.venv/bin/python -m pip install -r requirements-dev.txt
./.venv/bin/python -m pytest -q
./.venv/bin/python api_catalog.py --help
cd /workspace
rm -r "$proof_dir"

The awkward folder name is deliberate. A space and a non-ASCII character are exactly the things that break a project which secretly depends on its own location, and they are extremely common in the real folder names people actually use.

Check that pytest passes and help prints without dependency warnings. The final two commands return to the original project and remove only the unique copy created by mktemp, including its derived environment. rm removes files; its -r option also removes the named directory and its contents. This does not move them to Trash, so use the exact $proof_dir path created above. Your original six authored files remain in /workspace. Remove this proof folder before submitting; .venv, caches, bytecode, and the copy are derived state and do not belong in the handoff.

What does the second clean root prove?

Task

Use the documented dev recipe to run fake-HTTP tests and --help, then repeat from a disposable copied root under /workspace with a space and non-ASCII name. Use a unique new folder and a new environment, then return to the original root and remove only that proof copy. Submit only the exact six authored files; no environments, caches, copy, or generated output.