Skip to content

chore: update .rhiza/tests to the rhiza v1.3.3 layout, and make it pass - #92

Open
tschm wants to merge 2 commits into
alihaskar:masterfrom
tschm:rhiza_v1.3.3_tests
Open

chore: update .rhiza/tests to the rhiza v1.3.3 layout, and make it pass#92
tschm wants to merge 2 commits into
alihaskar:masterfrom
tschm:rhiza_v1.3.3_tests

Conversation

@tschm

@tschm tschm commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Updates .rhiza/tests to the layout shipped by rhiza v1.3.3, and fixes the two things in pyproject.toml that the new checks catch.

The test layout

v1.3.3 replaces the nested .rhiza/tests/{api,integration,shell,stress,structure,sync,utils} tree with five flat modules — 25 files, +445 / −2627:

New path Origin
.rhiza/tests/test_docstrings.py moved unchanged from sync/
.rhiza/tests/test_pyproject.py moved from structure/, ~50% rewritten
.rhiza/tests/test_readme_validation.py moved from sync/, ~40% rewritten
.rhiza/tests/test_readme.py new
.rhiza/tests/test_release_tags.py new

conftest.py and README.md are updated in place. Everything else in the old tree goes, including test_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 the License :: trove classifiers, so License :: OSI Approved :: MIT License comes out of [project].classifiers. license = {text = "MIT"} still carries it: the built wheel reports License: MIT with 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.cfg and pyproject.toml, and on finding none it does not fail — it falls back to git describe and 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 in pyproject.toml: three settings and no current_version, since bump-my-version reads and rewrites PEP 621 [project].version natively and a second copy of the number would only drift. commit and tag stay false so 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:

Skip Why
test_docstrings.pyNo doctests were found in any module The module docstrings use ```python fences, which doctest never sees. #88 converts them to >>> examples, so this clears once that merges.
test_pyproject.py::TestGitTagVersionNo version tags found The repository has no version tags at all.
test_release_tags.pyNo version tags found Same.

Scope

This is one part of a v0.18.8v1.3.3 template 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 the pyproject.toml bumpversion fix if the template churn is not something you want to take.

tschm and others added 2 commits August 18, 2026 00:11
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 updated conftest.py/README).
  • Updates pyproject.toml by removing deprecated License :: 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.classifiers skips when [project].classifiers is 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:219
  • dependency_groups skips when [dependency-groups] is missing or malformed, which prevents the subsequent tests from enforcing that the test group 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 thread .rhiza/tests/conftest.py
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 thread .rhiza/tests/README.md
Comment on lines +73 to +74
`.rhiza/tests` is on `pythonpath` (see `pytest.ini`), so intra-suite imports resolve
without any `sys.path` manipulation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants