|
| 1 | +# mypackage |
| 2 | + |
| 3 | +Minimal test project for manual validation of `reqstool-python-hatch-plugin`. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +A `.venv` must exist inside this directory with the plugin, Hatch, pytest, and reqstool installed. |
| 8 | +If it is missing, recreate it from `tests/fixtures/test_project/`: |
| 9 | + |
| 10 | +```bash |
| 11 | +python3.13 -m venv .venv |
| 12 | +.venv/bin/pip install -e ../../../ # install plugin in editable mode |
| 13 | +.venv/bin/pip install hatch pytest reqstool |
| 14 | +``` |
| 15 | + |
| 16 | +## Validation |
| 17 | + |
| 18 | +Run all commands from `tests/fixtures/test_project/`. |
| 19 | + |
| 20 | +### 1 — Run tests |
| 21 | + |
| 22 | +```bash |
| 23 | +.venv/bin/pytest tests/ --junit-xml=build/test-results/junit.xml -v |
| 24 | +``` |
| 25 | + |
| 26 | +Expected: `test_hello` passes. |
| 27 | + |
| 28 | +### 2 — Build |
| 29 | + |
| 30 | +```bash |
| 31 | +HATCH_ENV_TYPE_VIRTUAL_PATH=.venv .venv/bin/hatch build |
| 32 | +``` |
| 33 | + |
| 34 | +Expected output (sdist phase): |
| 35 | +1. `[reqstool] plugin <x.y.z> loaded` |
| 36 | +2. `[reqstool] added reqstool_config.yml to dist/mypackage-0.1.0.tar.gz` |
| 37 | + |
| 38 | +### 3 — Check artefacts |
| 39 | + |
| 40 | +```bash |
| 41 | +# annotations.yml must exist locally |
| 42 | +test -f build/reqstool/annotations.yml && echo "OK: annotations.yml" |
| 43 | + |
| 44 | +# reqstool_config.yml must NOT be in project root (injected directly into tarball) |
| 45 | +test ! -f reqstool_config.yml && echo "OK: no loose reqstool_config.yml" |
| 46 | + |
| 47 | +# sdist must contain reqstool_config.yml and dataset files |
| 48 | +tar -tzf dist/mypackage-0.1.0.tar.gz | sort |
| 49 | +``` |
| 50 | + |
| 51 | +Expected entries in the sdist: |
| 52 | +- `mypackage-0.1.0/reqstool_config.yml` |
| 53 | +- `mypackage-0.1.0/docs/reqstool/requirements.yml` |
| 54 | +- `mypackage-0.1.0/docs/reqstool/software_verification_cases.yml` |
| 55 | + |
| 56 | +Note: unlike the poetry plugin, hatch injects `reqstool_config.yml` directly into the tarball |
| 57 | +and does not bundle `annotations.yml` — those are generated locally in `build/reqstool/`. |
| 58 | + |
| 59 | +### 4 — Run reqstool status |
| 60 | + |
| 61 | +Extract the sdist and merge in the local build outputs, then run `reqstool status`: |
| 62 | + |
| 63 | +```bash |
| 64 | +mkdir -p /tmp/mypackage-reqstool |
| 65 | +tar -xzf dist/mypackage-0.1.0.tar.gz -C /tmp/mypackage-reqstool |
| 66 | +mkdir -p /tmp/mypackage-reqstool/mypackage-0.1.0/build/reqstool |
| 67 | +mkdir -p /tmp/mypackage-reqstool/mypackage-0.1.0/build/test-results |
| 68 | +cp build/reqstool/annotations.yml /tmp/mypackage-reqstool/mypackage-0.1.0/build/reqstool/ |
| 69 | +cp build/test-results/junit.xml /tmp/mypackage-reqstool/mypackage-0.1.0/build/test-results/ |
| 70 | +.venv/bin/reqstool status local -p /tmp/mypackage-reqstool/mypackage-0.1.0 |
| 71 | +``` |
| 72 | + |
| 73 | +Expected: all green — `REQ_001` implemented, `T1 P1`, no missing tests or SVCs. |
0 commit comments