Skip to content

Ship the LinkML source with the package - #37

Merged
jdkent merged 1 commit into
mainfrom
feat/package-linkml
Oct 15, 2026
Merged

jdkent merged 1 commit into
mainfrom
feat/package-linkml

Conversation

@jdkent

@jdkent jdkent commented Oct 15, 2026

Copy link
Copy Markdown
Member

The LinkML YAML sat at the repo root, outside the package, so a consumer that depends on study_schema could reach it only through a git export. Neurostore's tests did exactly that, with a gitignored git archive of the pinned commit. This is the fourth of the PRs for neurostore's review app.

What changes

  • The LinkML moves. The schemas, their module directories and extraction-evidence.yaml move to src/study_schema/linkml/, shipped as package data. Git shows them as renames.
    • extraction-deviations.yaml and extraction-to-storage.map.yaml move with them, because pondie checks the projection against them.
    • storage-parameter-priorities.yaml is triage data and stays at the root; the README says it isn't packaged.
  • Path constants. study_schema.linkml.EXTRACTION, STORAGE and PAPER_PARSE are pathlib.Paths of the three schemas. Relative imports resolve inside the packaged tree.
  • The generator. tools/generate_models.py reads the schemas through that module. Generated output is unchanged (--check).
  • Docs. The README states the location once, and the docs' links are updated.

Needs a change in pondie: python3 -m pondie.schema.generate writes these files to the repo root. It must write into src/study_schema/linkml/ instead, or regenerating will leave stale copies at the root.

Tests

  • tests/test_linkml.py checks that every constant points at a packaged schema, and that every relative import resolves inside the packaged tree.
  • It also builds a wheel with setuptools.build_meta and checks every YAML file is in it, the two moved contract files by name. CI's pip install provides setuptools, so this test runs there.
  • With linkml 1.12: pytest tests passes (125 passed, 2 skipped where setuptools or pyarrow is missing locally), and generate_models.py --check passes.

🤖 Generated with Claude Code

The LinkML YAML sat at the repo root, outside the package, so a
consumer that depends on study_schema could reach it only through a git
export. It now lives under src/study_schema/linkml/, shipped as package
data, with study_schema.linkml.EXTRACTION, STORAGE and PAPER_PARSE as
the paths of the three schemas. The extraction deviations and the
extraction-to-storage map, which pondie checks the projection against,
moved with them; storage-parameter-priorities.yaml is triage data and
stays at the root.

The generator reads its schemas through the same module, and a test
builds a wheel and checks every YAML file is in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdkent
jdkent merged commit aafea02 into main Oct 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant