From 9e9049a5ff818aa951f60ed0a0c6bccf2ca4f30c Mon Sep 17 00:00:00 2001 From: robfrank Date: Fri, 23 Oct 2026 01:25:03 +0200 Subject: [PATCH] docs(#6): drop the monorepo wording after the move _version.py is derived from the engine jar's version, not a Maven pom, and there is no repo-root uv project: tests run against the wheel installed with its test extra into .venv. README, tests/README, the pyproject [tool.uv] comment and build.sh's next steps say so, with commands that work on every rebuild (--reinstall-package, as a rebuild keeps the version). build.sh no longer points at a docs/development/release.md this repository does not have. tests/test_no_monorepo_wording.py keeps it so. Co-Authored-By: Claude Opus 5.5 --- README.md | 10 ++++++-- pyproject.toml | 8 +++--- scripts/build.sh | 6 ++--- src/arcadedb_embedded/__init__.py | 3 ++- tests/README.md | 9 ++++++- tests/test_jar_provenance.py | 3 ++- tests/test_no_monorepo_wording.py | 41 +++++++++++++++++++++++++++++++ tests/test_wheel_platform_tag.py | 2 +- 8 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 tests/test_no_monorepo_wording.py diff --git a/README.md b/README.md index 3b0390b..60d089a 100644 --- a/README.md +++ b/README.md @@ -96,10 +96,16 @@ Import: `import arcadedb_embedded as arcadedb` ## 🧪 Testing -Tests run against the built wheel via the uv project at the repo root. No -virtualenv activation is needed, and `uv run` works from anywhere in the repo: +Tests run against the built wheel, installed with its `test` extra into a +virtual environment. Once that is set up, `uv run` uses it without activation: ```bash +# Once +uv venv + +# After each build: --reinstall-package, as a rebuild keeps the version (26.11.1.dev0) +uv pip install --reinstall-package arcadedb-embedded "$(ls dist/*.whl | head -1)[test]" + # Run all tests uv run pytest diff --git a/pyproject.toml b/pyproject.toml index 907c267..37269b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,10 +37,10 @@ dependencies = [ [tool.uv] # This pyproject is the *package definition* consumed by the wheel build -# (scripts/build.sh via Docker). It is not a uv project: the dev/test -# environment lives in the repo-root pyproject.toml, which installs the built -# wheel from dist/. `managed = false` makes uv skip this directory during -# project discovery, so `uv run` from here resolves to the repo-root project. +# (scripts/build.sh). It is not a uv project: tests run against the built wheel, +# installed with its `test` extra into a virtual environment (see README, +# Testing). `managed = false` makes uv skip it during project discovery, so +# `uv run` uses that environment instead of trying to sync this package. managed = false [project.optional-dependencies] diff --git a/scripts/build.sh b/scripts/build.sh index a182a12..49b4a95 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -517,9 +517,7 @@ fi echo "" echo -e "${BLUE}💡 Next steps:${NC}" -echo -e " 🧪 Run tests (from the repository root):" +echo -e " 🧪 Run tests against this wheel (from the repository root; uv venv once first):" +echo -e " ${YELLOW}uv pip install --reinstall-package arcadedb-embedded \"[test]\"${NC}" echo -e " ${YELLOW}uv run pytest${NC}" echo "" -echo -e " 📤 Releases publish through the release workflow (docs/development/release.md);" -echo -e " do not upload wheels by hand" -echo "" diff --git a/src/arcadedb_embedded/__init__.py b/src/arcadedb_embedded/__init__.py index 7c57b4f..83e575a 100644 --- a/src/arcadedb_embedded/__init__.py +++ b/src/arcadedb_embedded/__init__.py @@ -7,7 +7,8 @@ # The installed distribution's version is the single source of truth: the # wheel is versioned from the release tag, while the generated _version.py -# is derived from the Maven pom, so the two disagree on tagged releases +# is derived from the engine jar's version (scripts/write_version.py), so the +# two disagree on tagged releases # (a 26.8.1.dev20 wheel carried __version__ == "26.8.1.dev0"). Fall back to # the generated file, then to a placeholder, for source checkouts that were # never installed. diff --git a/tests/README.md b/tests/README.md index b030b6c..3d2df58 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,7 +7,14 @@ The [Testing Guide](https://docs.humem.ai/arcadedb/latest/development/testing/) ## Running Tests ```bash -# Run all tests (dependencies come from the repo-root uv project) +# Once +uv venv + +# After each build: the wheel and its test extra into .venv. --reinstall-package, +# as a rebuild keeps the version (26.11.1.dev0) +uv pip install --reinstall-package arcadedb-embedded "$(ls dist/*.whl | head -1)[test]" + +# Run all tests uv run pytest # Run specific file diff --git a/tests/test_jar_provenance.py b/tests/test_jar_provenance.py index af96863..a49f7ea 100644 --- a/tests/test_jar_provenance.py +++ b/tests/test_jar_provenance.py @@ -1,6 +1,7 @@ """The wheel can say which engine it carries, not just which version it is. -`__version__` is the package version. It is baked from the pom and says +`__version__` is the package version. It is baked from the engine jar's +version (scripts/write_version.py) and says nothing about the JARs that ended up in the wheel, so a build from a locally patched Java tree reports the released version while shipping a different engine. That happened: a local build shipped 59 JARs instead of 64 with a diff --git a/tests/test_no_monorepo_wording.py b/tests/test_no_monorepo_wording.py new file mode 100644 index 0000000..f97cde3 --- /dev/null +++ b/tests/test_no_monorepo_wording.py @@ -0,0 +1,41 @@ +"""No text describes the monorepo layout this package moved out of (#6). + +The version comes from the engine jar (scripts/extract_version.py), not a +Maven pom, and there is no repo-root uv project wrapping this package: tests +run against the wheel installed into a virtual environment (README, Testing). +""" + +from __future__ import annotations + +import re +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +STALE = re.compile(r"Maven pom|from the pom|repo-root|docs/development/", re.IGNORECASE) +# Text in double quotes is a quotation (a docstring citing what the code used +# to say), not a claim about the layout. +QUOTED = re.compile(r'"[^"]*"') + + +def _texts(): + yield from (ROOT / "src").rglob("*.py") + yield from ( + p for p in (ROOT / "tests").rglob("*.py") if p.name != Path(__file__).name + ) + yield from (ROOT / "scripts").glob("*") + yield from ( + ROOT / name for name in ("pyproject.toml", "README.md", "tests/README.md") + ) + + +def test_no_monorepo_wording(): + hits = [ + f"{path.relative_to(ROOT)}:{number}: {line.strip()}" + for path in _texts() + if path.is_file() + for number, line in enumerate( + path.read_text(encoding="utf-8", errors="replace").splitlines(), start=1 + ) + if STALE.search(QUOTED.sub("", line)) + ] + assert hits == [] diff --git a/tests/test_wheel_platform_tag.py b/tests/test_wheel_platform_tag.py index d655e02..8651ab8 100644 --- a/tests/test_wheel_platform_tag.py +++ b/tests/test_wheel_platform_tag.py @@ -139,7 +139,7 @@ def test_module_exposes_public_api() -> None: def test_dunder_version_matches_distribution_metadata(): """__version__ must equal the installed distribution version. - Regression: _version.py is generated from the Maven pom (26.8.1-SNAPSHOT + Regression: _version.py is generated from the engine version (26.8.1-SNAPSHOT -> 26.8.1.dev0) while the wheel is versioned from the release tag, so a published 26.8.1.dev20 wheel reported __version__ == "26.8.1.dev0". Anything reading the version programmatically (our own benchmark