chore: update .rhiza/tests to the rhiza v1.3.3 layout, and make it pass - #92
Open
tschm wants to merge 2 commits into
Open
chore: update .rhiza/tests to the rhiza v1.3.3 layout, and make it pass#92tschm wants to merge 2 commits into
tschm wants to merge 2 commits into
Conversation
v1.3.3 replaces the nested .rhiza/tests/{api,integration,shell,stress,
structure,sync,utils} tree with five flat modules. test_docstrings.py moves
unchanged; test_pyproject.py and test_readme_validation.py move and are
rewritten; test_readme.py and test_release_tags.py are new. The rest of the
old tree goes, along with test_utils.py, whose helpers the flat modules no
longer import.
Isolated from #27 on request so the test-suite churn — 445 insertions
against 2627 deletions — is reviewable on its own.
Note that it does not stand up alone: quality.mk's rhiza-test provisions
this layout's dependencies (pytest-timeout, python-dotenv, packaging),
python.mk reads .rhiza/tests/test_pyproject.py, and pytest.ini supplies the
pythonpath these modules import through. All three land in #27, which is
stacked on this branch. Expect CI to be red here until both have merged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
test_no_license_classifier: PyPI deprecated the `License ::` trove
classifiers in favour of the license field, so the MIT one is dropped.
`license = {text = "MIT"}` still carries it — the built wheel reports
License: MIT with no license classifiers.
test_a_discoverable_config_exists: the bumpversion config lived in
.rhiza/.cfg.toml, which bump-my-version never searches. It searches
.bumpversion.toml, .bumpversion.cfg, setup.cfg and pyproject.toml, and on
finding none does not fail — it falls back to `git describe` and treats the
newest reachable tag as the current version, so a release can be cut at a
number already published. A [tool.bumpversion] table now lives in
pyproject.toml.
The table is deliberately three settings and no current_version:
bump-my-version rewrites PEP 621 [project].version natively, and commit/tag
stay false because the release flow makes its own commit and tag. The stale
.rhiza/.cfg.toml is removed in the stacked PR, where the rest of the paths
v1.3.3 dropped are removed; until then it is inert, since nothing
auto-discovers that path.
.rhiza/tests now reports 37 passed, 3 skipped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR syncs the repository’s .rhiza/tests suite to the Rhiza v1.3.3 flat-module layout and updates pyproject.toml to satisfy newly introduced template checks (license classifier deprecation + discoverable bump-my-version configuration).
Changes:
- Replaces the old
.rhiza/tests/{api,integration,shell,stress,structure,sync,utils}tree with a flat set of focused test modules (plus updatedconftest.py/README). - Updates
pyproject.tomlby removing deprecatedLicense ::trove classifiers and adding a minimal[tool.bumpversion]config in a discoverable location. - Introduces new/updated core checks for README bash-fence parsing and for tag reachability invariants.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Removes deprecated license classifier and adds [tool.bumpversion] config discoverable by bump-my-version. |
.rhiza/tests/conftest.py |
Simplifies suite fixtures to session-scoped root, logger, and latest_tag. |
.rhiza/tests/README.md |
Updates documentation to describe the new flat test layout and behavior. |
.rhiza/tests/test_docstrings.py |
Adds doctest discovery/execution across importable modules under the source folder. |
.rhiza/tests/test_pyproject.py |
Updates pyproject structure checks and adds bumpversion discoverability/shadowing assertions. |
.rhiza/tests/test_readme.py |
Adds README existence and bash fence syntax validation via bash -n. |
.rhiza/tests/test_readme_validation.py |
Narrows README execution checks to python fences only (bash moved to test_readme.py). |
.rhiza/tests/test_release_tags.py |
Adds invariant that the newest tag is reachable from at least one branch. |
.rhiza/tests/test_utils.py |
Removes shared test utilities (no longer referenced by the flat suite). |
.rhiza/tests/utils/test_git_repo_fixture.py |
Removes git repo fixture tests (fixture no longer present/used in new layout). |
.rhiza/tests/api/conftest.py |
Removes API test harness conftest (API test bundle removed in new layout). |
.rhiza/tests/api/test_github_targets.py |
Removes GitHub-target makefile tests (API bundle removed). |
.rhiza/tests/api/test_make_variable_overrides.py |
Removes make variable override tests (API bundle removed). |
.rhiza/tests/api/test_makefile_api.py |
Removes Makefile API tests (API bundle removed). |
.rhiza/tests/api/test_makefile_targets.py |
Removes Makefile target tests (API bundle removed). |
.rhiza/tests/integration/test_book_targets.py |
Removes integration tests (integration bundle removed). |
.rhiza/tests/integration/test_docs_targets.py |
Removes integration tests (integration bundle removed). |
.rhiza/tests/integration/test_test_mk.py |
Removes integration tests (integration bundle removed). |
.rhiza/tests/integration/test_virtual_env_unexport.py |
Removes integration tests (integration bundle removed). |
.rhiza/tests/shell/test_scripts.sh |
Removes shell-script suite (shell bundle removed). |
.rhiza/tests/stress/__init__.py |
Removes stress test package (stress bundle removed). |
.rhiza/tests/stress/conftest.py |
Removes stress test fixtures/options (stress bundle removed). |
.rhiza/tests/stress/README.md |
Removes stress bundle documentation (stress bundle removed). |
.rhiza/tests/structure/test_project_layout.py |
Removes structure checks (structure bundle removed). |
.rhiza/tests/structure/test_requirements.py |
Removes requirements structure checks (structure bundle removed). |
.rhiza/tests/sync/conftest.py |
Removes sync test environment harness (sync bundle removed). |
Suppressed comments (2)
.rhiza/tests/test_pyproject.py:178
TestProjectClassifiers.classifiersskips when[project].classifiersis missing/empty, but this module’s contract says we require at least one Python version classifier. Skipping here means a project with no classifiers will still pass the suite.
.rhiza/tests/test_pyproject.py:219dependency_groupsskips when[dependency-groups]is missing or malformed, which prevents the subsequent tests from enforcing that thetestgroup exists and includes pytest (as described in the module docstring).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+63
to
+72
| result = subprocess.run( # nosec B603 | ||
| [_GIT, "tag", "--list", "v*", "--sort=-version:refname"], | ||
| capture_output=True, | ||
| text=True, | ||
| cwd=root, | ||
| ) | ||
| tags = [line.strip() for line in result.stdout.splitlines() if line.strip()] | ||
| if not tags: | ||
| pytest.skip("No version tags found in repository") | ||
| return tags[0] |
Comment on lines
+73
to
+74
| `.rhiza/tests` is on `pythonpath` (see `pytest.ini`), so intra-suite imports resolve | ||
| without any `sys.path` manipulation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates
.rhiza/teststo the layout shipped by rhizav1.3.3, and fixes the two things inpyproject.tomlthat the new checks catch.The test layout
v1.3.3replaces the nested.rhiza/tests/{api,integration,shell,stress,structure,sync,utils}tree with five flat modules — 25 files, +445 / −2627:.rhiza/tests/test_docstrings.pysync/.rhiza/tests/test_pyproject.pystructure/, ~50% rewritten.rhiza/tests/test_readme_validation.pysync/, ~40% rewritten.rhiza/tests/test_readme.py.rhiza/tests/test_release_tags.pyconftest.pyandREADME.mdare updated in place. Everything else in the old tree goes, includingtest_utils.py, whose helpers the flat modules no longer import.The two repo fixes
The new checks fail against the repo as it stands, so a second commit fixes the repo rather than the tests:
test_no_license_classifier— PyPI deprecated theLicense ::trove classifiers, soLicense :: OSI Approved :: MIT Licensecomes out of[project].classifiers.license = {text = "MIT"}still carries it: the built wheel reportsLicense: MITwith no license classifiers.test_a_discoverable_config_exists— worth reading even if you take nothing else from this PR. The bumpversion config lives in.rhiza/.cfg.toml, which bump-my-version never searches. It looks at.bumpversion.toml,.bumpversion.cfg,setup.cfgandpyproject.toml, and on finding none it does not fail — it falls back togit describeand treats the newest reachable tag as the current version. Release tooling then computes the next version from that tag instead of from[project].version, which is how a project ends up cutting a release at a number it has already published.A
[tool.bumpversion]table now lives inpyproject.toml: three settings and nocurrent_version, since bump-my-version reads and rewrites PEP 621[project].versionnatively and a second copy of the number would only drift.commitandtagstayfalseso the release flow keeps ownership of its own commit and tag.Result
.rhiza/tests: 37 passed, 3 skipped. The three skips are repo state, not defects:test_docstrings.py— No doctests were found in any module```pythonfences, which doctest never sees. #88 converts them to>>>examples, so this clears once that merges.test_pyproject.py::TestGitTagVersion— No version tags foundtest_release_tags.py— No version tags foundScope
This is one part of a
v0.18.8→v1.3.3template sync. The rest — Makefile plumbing, workflow pins,.rhiza/make.d— is coupled and sits in tschm#27 in my fork; it needs this branch underneath it. I am happy to send that too if this direction is welcome, or to trim this PR to just thepyproject.tomlbumpversion fix if the template churn is not something you want to take.