Skip to content

Contributors: test a Python-only change over a borrowed wheel (scripts/dev_overlay.py) - #438

Merged
tae898 merged 1 commit into
mainfrom
docs/contributor-python-fast-path
Nov 22, 2026
Merged

tae898 merged 1 commit into
mainfrom
docs/contributor-python-fast-path

Conversation

@tae898

@tae898 tae898 commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #437

What does this PR do?

It lets a contributor test a Python-only change without building a wheel. The research and the trial results are in #437.

  • scripts/dev_overlay.py (standard library only). Run inside uv run --no-project --with <wheel>, it puts the .py files of the checkout over the installed wheel, links what only the wheel has (jars, JRE, native libraries, the generated _version.py or _build_info.py), and runs the arguments it is given as python <arguments> with the overlay first on PYTHONPATH. The overlay is made again on every run. It also lists the files on the binary side that changed since the wheel was built (SOURCE_COMMIT of a native wheel, the tag of a release), so a stale wheel is named before a test fails for a reason that is not in the change.
  • native/wheel/build_wheel.py: the source rewrite of the native wheel (jpype stub, default backend, _build_info imports) moves out of main() into nativize_sources(), text unchanged, so the overlay and the wheel build share one function.
  • CONTRIBUTING.md: a section "Change Python code without building a wheel" that says where to get a wheel (the artifacts of main, or a release), when the shortcut is valid (Python files only; not src/java, not native/, not a change that needs a newer engine), and that CI still builds and tests the real wheels.
  • tests/test_dev_overlay.py runs the script against the wheel under test, so each CI leg shows that the overlay imports on its platform. .gitignore gets .dev-overlay/.

CI is unchanged.

How I checked it

On Linux x86-64 with Python 3.12, with the Python sources of main (5592084) plus this branch over each wheel: import arcadedb, create a database, insert five rows, query them.

Wheel Package Result
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, which shows that nativize_sources() writes what the inline code wrote.
26.11.1.post4 from PyPI arcadedb-jvm Works. The script reports that src/java did not change since the release.
26.11.1.post4 from PyPI arcadedb The script warns that files under native/ changed, and the import then fails on the generated _build_info.py of that wheel (details in #437). This is the case the warning is for.

Pre-commit, compile(), pyflakes and the Bandit command of CI pass on the changed files.

One thing I could not do: run the test suite on my machine. The new test has not run anywhere yet, so the checks of this PR are its first run. I checked by hand that the script prints what the test asserts (the imported file is in the overlay, the backend, the version, sources as real files). Please look at the Windows legs in particular: the script links files and falls back to copies when links are not allowed, and I could only try Linux. The native Windows, macOS and aarch64 legs do not run on a pull request, so they first run on main.

Docs

CONTRIBUTING.md has the new section. No page under docs/ describes the contributor setup, and README.md does not either, so neither changes.

Checklist

  • A regression test fails on the old code and passes on the new (a new test for the new script; not run locally, see above)
  • The test suite that the change can affect passes (left to CI, see above)
  • uvx pre-commit run --files <changed files> passes

…ipts/dev_overlay.py (refs #437)

A contributor who changes only Python had to build a wheel before one test could run, and the native image takes 5 to 30 minutes. scripts/dev_overlay.py puts the .py files of the checkout over an installed wheel (a wheel CI built from main, or a release), links what only the wheel has (jars, JRE, libraries, generated files), and runs the given command with the overlay first on PYTHONPATH. It lists the files on the binary side that changed since the wheel was built, from SOURCE_COMMIT of a native wheel or the tag of a release.

The native wheel holds rewritten sources (the jpype stub, the default backend, the _build_info imports). That rewrite moves out of main() of native/wheel/build_wheel.py into nativize_sources(), text unchanged, so the overlay and the wheel build share one function. Checked on the wheels CI built from 5592084: all 38 .py files of the native overlay are byte-identical to the wheel's, and all 37 of the JVM overlay.

tests/test_dev_overlay.py runs the script against the wheel under test, so every CI leg shows the overlay imports on its platform. CONTRIBUTING.md says where to get a wheel and when the shortcut is valid. CI itself is unchanged and still tests the built wheels.
@tae898 tae898 added enhancement New feature or request python Pull requests that update python code labels Nov 22, 2026
@tae898 tae898 self-assigned this Nov 22, 2026
@tae898
tae898 merged commit b62ae44 into main Nov 22, 2026
44 checks passed
@tae898
tae898 deleted the docs/contributor-python-fast-path branch November 22, 2026 12:18
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A Python-only change needs a wheel build before a contributor can run one test

1 participant