Repository navigation
fix(python): build the _telemetry extension out of tree - #2118
Merged
Merged
Conversation
jepsontaylor
marked this pull request as draft
November 4, 2026 00:37
jepsontaylor
marked this pull request as ready for review
November 4, 2026 00:37
jepsontaylor
marked this pull request as draft
November 4, 2026 01:20
jepsontaylor
marked this pull request as ready for review
November 4, 2026 01:20
neverhumanbot
force-pushed
the
fix/telemetry-out-of-tree
branch
from
November 4, 2026 01:41
4b2adc4 to
3175dce
Compare
jepsontaylor
marked this pull request as draft
November 4, 2026 01:41
jepsontaylor
marked this pull request as ready for review
November 4, 2026 01:41
maturin editable installs copy a mixed project's extension module into its python-source directory, so every cold `uv sync` (including CI on xbabe2-ci) wrote python/src/jope/_telemetry.cpython-*.so into the source tree. main hid that with a .gitignore entry, which also hid stray artifacts from the receipt dirty-source check. - New python/native distribution `jope-native` (maturin, module jope_native._telemetry, same crates/jope-telemetry `python` feature, no Rust change). uv installs it from a path source with editable = false, so the .so lives only in the venv's site-packages and the build uses the cargo target dir. uv cache-keys cover the Rust sources so edits rebuild it. - jope itself is now a pure-Python hatchling package (editable as before). python/src/jope/_telemetry.py aliases sys.modules["jope._telemetry"] to the extension, so imports, class identity and __file__ (hashed by run_fused_closed_loop.py) are unchanged. - .gitignore no longer ignores python/src/jope/_telemetry*.so/.pyd: a stray one would shadow the alias and must stay visible to git status and receipt.py. test_telemetry_smoke asserts the extension is loaded from outside python/src and that no .so/.pyd exists there. - uv.lock: adds jope-native only. PYTHON_EXCEPTIONS.md registers the two new FFI shim files. Approved-by: Jepson (t271u, 2026-11-03 16:57 MST): "Please start on what you think is best, we want to get to a clean main and work to simplify updates ASAP" Agent-Session: wt-telemetry-oot Agent-Model: gpt-6-luna medium Agent-Task: fix/telemetry-out-of-tree
…/src Review follow-up: a native artifact anywhere under the editable source root, not only python/src/jope, must fail the smoke test. Agent-Session: wt-telemetry-oot Agent-Model: gpt-6-luna medium Agent-Task: fix/telemetry-out-of-tree
neverhumanbot
force-pushed
the
fix/telemetry-out-of-tree
branch
from
November 4, 2026 02:09
3175dce to
c5690a1
Compare
jepsontaylor
marked this pull request as draft
November 4, 2026 02:09
jepsontaylor
marked this pull request as ready for review
November 4, 2026 02:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Post-release cleanup (after #2115).
Problem.
python/was a mixed maturin project, and maturin editable installs copy the extension into the python-source dir, so every colduv sync(CI on xbabe2-ci included) wrotepython/src/jope/_telemetry.cpython-*.sointo the tree. R9094 hid that with a.gitignoreentry, which also hid stray artifacts from the receiptdirty_source_aftercheck.Fix.
python/nativedistributionjope-native(maturin, modulejope_native._telemetry, samecrates/jope-telemetrypythonfeature; no Rust change).python/pyproject.tomldepends on it via[tool.uv.sources] jope-native = { path = "native", editable = false }, so the.soonly exists in the venv's site-packages; the build uses the cargo target dir. uvcache-keysinclude the Rust sources so edits trigger a rebuild.jopeis now a pure-Python hatchling package (still editable).python/src/jope/_telemetry.pyaliasessys.modules["jope._telemetry"]to the extension, so all imports, class/exception identity and__file__(hashed byrun_fused_closed_loop.py) are unchanged..gitignore: the_telemetry*.so/.pydignores are removed (tightened). A stray in-tree.sowould shadow the alias, so it must stay visible togit status/receipt.py.test_telemetry_smoke.py::test_extension_is_built_out_of_treeasserts the extension loads from outsidepython/srcand no.so/.pydexists there.uv.lockadds onlyjope-native. Bookkeeping:PYTHON_EXCEPTIONS.md(2 FFI shims), README At-a-glance counts anddocs/parity/test-inventory.json(+1 test).Local verification (xbabe2, cold uv cache, fresh venv):
uv sync --locked ...buildsjope-nativefrom the path source;git status --porcelain --untracked-files=allstays clean; python lane viareceipt.py:dirty_source=[],dirty_source_after=[], pytest 472 passed / 0 failed, training-proof, benchmark, dl-offline group, flywheel-offline all pass.run_v2_offline.pypassed standalone (237/237) but takes about 604 s wall on the loaded host, just over the lane's 600 stimeout. That happens on main as well and is unrelated to this change.deploy/ci/check.sh(hygiene) passes, including coverage validate, paper-trace, repo-layout and test inventory.Approved-by: Jepson (t271u, 2026-11-03 16:57 MST): "Please start on what you think is best, we want to get to a clean main and work to simplify updates ASAP"