Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 2 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \"<the wheel above>[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 ""
3 changes: 2 additions & 1 deletion src/arcadedb_embedded/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 8 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_jar_provenance.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
41 changes: 41 additions & 0 deletions tests/test_no_monorepo_wording.py
Original file line number Diff line number Diff line change
@@ -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 == []
2 changes: 1 addition & 1 deletion tests/test_wheel_platform_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading