Repository navigation
Description
Today a contributor who changes one line of Python has to build a wheel before a single test can run, because the tests run against a built wheel. For arcadedb-jvm that is ./scripts/build.sh (Docker on Linux, a JDK 25 elsewhere). For arcadedb it is a GraalVM native image, about 5 to 30 minutes per platform. I would like a Python-only contribution to be easy, without weakening what CI checks.
What other projects do
I looked at the contributor docs of projects that ship a compiled or bundled core with Python on top.
| Project | Shortcut for a Python-only change | Source |
|---|---|---|
| Ray | Yes. Install the nightly wheel, then python python/ray/setup-dev.py links the checkout over it. |
Building Ray (Python only) |
| PyTorch | Yes. tools/nightly.py links the binaries of the nightly wheel into the checkout and moves the checkout to the commit the binary was built from. |
CONTRIBUTING.md, tools/nightly.py |
| PyArrow | No, Arrow C++ is built first. The nightly wheels are for downstream CI. | Building PyArrow |
| NumPy, SciPy | No, spin build. The nightly wheels (SPEC 4) are for downstream projects. |
NumPy, SciPy, SPEC 4 |
| Polars | No, the Rust build is part of make test. |
Contributing |
| cryptography | No, Rust is required. | Getting started |
| PySpark | No, Spark is built with Maven or sbt first. | Testing PySpark |
So most projects ask for the full build. The two that offer a shortcut do the same thing: put the Python sources of the checkout over a binary that was built from (almost) the same commit, and PyTorch also checks the commit.
What this repository can offer today
Both test workflows already upload the wheels they build from main: wheel-<platform> from test-jvm.yml (kept 7 days) and native-wheel-<platform> from test-native.yml (kept 30 days). The newest release on PyPI is 26.11.1.post4 for both packages, and main is 55 commits ahead of it.
I tried the overlay on Linux x86-64 with Python 3.12, at main = 5592084: the Python sources of main over each wheel, then import arcadedb, create a database, insert five rows, and query them.
| Wheel | Package | Result |
|---|---|---|
26.11.1.post4 from PyPI |
arcadedb-jvm |
Works. src/java did not change since the release. |
26.11.1.post4 from PyPI |
arcadedb |
The import fails (see below). |
wheel-linux-amd64 of run 44978877325 (main) |
arcadedb-jvm |
Works. All 37 .py files of the overlay are identical to the wheel's. |
native-wheel-linux-x86_64 of run 44981746741 (main) |
arcadedb |
Works. All 38 .py files of the overlay are identical to the wheel's. |
The native failure on the release is ImportError: cannot import name 'ENGINE_IMAGE_DIGEST' from 'arcadedb._build_info'. Since #304 (pull request #305), the native __init__.py imports ENGINE_SNAPSHOT and ENGINE_IMAGE_DIGEST from the generated _build_info.py, and the 26.11.1.post4 wheel was built without that change, so its file has neither. With the two names added by hand the same trial passes on that wheel. Its library also has no arcadedb_n_facets entry point yet: the loader accepts that, a test of facets would not.
So the shortcut is reliable with a wheel that CI built from main, and with a release as long as nothing the wheel is built from changed since. A script can tell the two cases apart, because the native wheel records its commit (SOURCE_COMMIT) and a release is a tag.
Proposal
scripts/dev_overlay.py(standard library only): run insideuv run --no-project --with <wheel>, it puts the.pyfiles of the checkout over the installed wheel, links the jars, the JRE, the libraries and the generated files of the wheel, applies the native rewrite for the native wheel (the same function the wheel build uses), lists the files that changed on the binary side since the wheel was built, and runs the command it is given.- A section in
CONTRIBUTING.md, "Change Python code without building a wheel": where to get the wheel, when the shortcut is valid (Python files only; notsrc/java, notnative/, not a change that needs a newer engine), and that CI still builds and tests the real wheels. - CI stays as it is.
Left to decide
- A rolling dev wheel on PyPI would spare the contributor the GitHub CLI and the 7 day limit of the JVM artifact. It does not fit the version rule as it is (a
devNpins one engine snapshot, and a number is never reused), so I did not propose it here. - The JVM wheel does not record the commit it was built from. If it did, as the native wheel does, the script could check
src/javafor a CI wheel too.
Activity
Contributors: run a Python-only change over a borrowed wheel with scr…