Repository navigation
MAINT: switch to the src/ layout - #104
Merged
Merged
Conversation
Collaborator
Author
|
One significant change is that TODO here:
|
ev-br
force-pushed
the
src-layout
branch
3 times, most recently
from
November 5, 2026 20:04
314ef36 to
a8198db
Compare
rok
previously approved these changes
Nov 6, 2026
rok
left a comment
Member
There was a problem hiding this comment.
Looks good! Mostly moving stuff around. CI seems to be passing ok, I propose we merge and do a separate PR for release automation.
Move the project from benchx/ up to the repository root and the package under src/: benchx/benchx -> src/benchx schemas -> src/benchx/schemas (package data, so a wheel carries them) benchx/tests -> tests benchx/examples -> examples benchx/demo.sh -> demo.sh benchx/pyproject.toml, benchx/uv.lock -> pyproject.toml, uv.lock benchx/README.md -> docs/benchx.md (the page the docs site already generated from it) This commit only renames: every file is a 100% rename, no content changes, so `git blame` and `git log --follow` see through it. The tree does not build or pass its tests at this commit; the next one updates the paths and the files that collide (LICENSE, .gitignore) with their root counterparts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…kage The previous commit moved the files; this one makes them work from their new places. Installs: the schemas are package data under src/benchx/schemas, and core/catalog.py finds them next to itself (parents[1]), so an installed wheel or sdist carries and finds them, as an editable install does. $BENCHX_SCHEMAS still overrides. Before, a non-editable install could not even run `bx --help`. pyproject.toml: packages = ["src/benchx"], readme = "docs/benchx.md". The wheel also ships the test suite as benchx/tests (hatch force-include), so an installed benchx can test itself: `python -m pytest --pyargs benchx`. tests/ stays where it is, and gets no __init__.py, which would break its `from conftest import ...` lines. Docs: docs/benchx.md is a tracked page now (the docs site used to generate it from benchx/README.md), so tools/gen_docs.py stops generating it and reads the schemas from their new place; the README and zensical.toml name the new locations. The built site is otherwise the same: the same pages and navbar, the schema pages' "source" links point at the new place. Housekeeping: benchx/LICENSE was identical to the root one and benchx/.gitignore is merged into the root .gitignore (plus dist/), which empties benchx/. CI: tests.yml no longer runs in a subdirectory and its path filters follow the move; a new `wheel` job builds the wheel, installs it (not editable) into a clean venv, activates the venv, and from outside the checkout runs `bx --help` and the test suite the wheel ships (`pytest --pyargs benchx`). docs.yml's filters follow the schemas. e2e.yml: the project is the root of the benchx checkout now, so `benchx/benchx` becomes `benchx` in its working directories, cache globs and venv paths. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The nav pointed at schemas/observed-context-record.md, a page that is never built: that schema was removed in benchx-dev#63, on the day the site was published. Zensical checks links inside pages but not nav entries, so the strict build did not notice. Two schemas that do have reference pages were missing from the nav: identity-policy and config. Add them ("Identity policy" next to the other identity entries, "Project configuration" last), so the nav lists every schema the generated index page lists. Page bodies are unchanged; only the navbar differs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The numpy-venvs job failed with "run.sh: cannot find a benchx checkout to install in
the venvs". The example's run.sh takes the checkout from the benchx of the active
environment, as benchx.__file__'s grandparent, and requires a pyproject.toml there.
That holds only when the package sits directly in the project directory. Under src/
it is the checkout's src/, which has none.
Set BENCHX_SRC, the script's own override, to the checkout (${{ github.workspace }}/benchx)
on the step that runs it, and correct the comment above the install step: the
environment no longer needs benchx in editable mode to find its schemas, which ship
in the package.
Checked by replaying the job in a mock workspace: without BENCHX_SRC the script fails
with that message (it computes <checkout>/src); with it, run.sh builds both venvs
(numpy 1.26.4 and 2.0.2), runs the rounds, compares, and exits 0.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Previously, we seem to have only used in-place installs, with
schemasfolder being outside of the installable package root. This does not play well with a proper out-of-place installs. Therefore, switch to a more traditionalsrc/layout expected for a python project.Specifically: the project lives at the repository root, with the package under
src/. The JSON schemas are packagedata, so a wheel carries them and a non-editable install works. The wheel also ships the test suite.
The project lives at the repository root, with the package under
src/. The JSON schemas are packagedata, so a wheel carries them and a non-editable install works. The wheel also ships the test suite.
The worked examples and
demo.share not in this repository any more: they live inbenchx_examples and run in the
e2eworkflow.What the wheel contains
98 files (93 package files and 5 of
.dist-infometadata):The sdist has 133 files (the sources,
tests/,docs/, the CI workflows and the root files).Runtime lookups
What moved where
benchx/benchx/src/benchx/schemas/src/benchx/schemas/benchx/tests/tests/(and copied into the wheel asbenchx/tests/)benchx/pyproject.toml,benchx/uv.lockpyproject.toml,uv.lockbenchx/README.mddocs/benchx.mdbenchx/LICENSE,benchx/.gitignoreLICENSEand.gitignorebenchx/examples/,benchx/demo.shbenchx/benchxine2e.ymlbenchx(andBENCHX_SRCfor numpy-venvs)Docs
Same pages as before, with the same navbar except for the Schemas entries. The built site differs on
the landing page (the Contents list) and the
benchxpage (the install line, plus one sentence on theshipped tests), in the schema pages' "source" links, which point at
src/benchx/schemas/…, and in thenavbar's Schemas section:
removed in Simplify context split and generalize identity using projections #63; Zensical does not validate nav entries, so the strict build never noticed);