Add guardrails for LinkML's compatibility constraints - #108
Merged
Merged
Conversation
LinkML asks that PyShEx releases not break compatibility, keep up with current Python, and not add unexpected heavyweight dependencies. - tests/test_contract: freeze the public API and the call patterns of known clients (linkml, jupyter-rdfify 1.0.4); run the real clients when installed. - tests/test_policy: runtime dependency allowlist from uv.lock, no version caps, imports match declared deps, Python versions consistent across classifiers/CI/tox and current with CPython releases. - .github/scripts/api_compat.py: griffe API diff against the previous release; breaks need a 'breaking-change' PR label or a major (0.x: minor) version bump. - CI: policy, downstream and python-next jobs; weekly schedule; run on pushes to master (was 'main'). Release workflow verifies the built wheel before publishing. - pre-commit hooks for the lockfile, contract/policy tests and API diff. - pytest config so a checked-out shexTest submodule doesn't break collection; add py314 to tox env_list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…res as warnings uv 0.7.13 predates Python 3.14.0, so every '3.14' job ran 3.14.0b2, and it fetched Python builds from an old release URL that failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m PyPI - Windows' default code page broke parsing pyshex sources and TOML. - New check: runtime packages in uv.lock must come from the PyPI registry. [tool.uv.sources] git/path overrides don't reach published wheels, so CI would test different code than users install. - SKIP_EXTERNAL_URLS=false no longer disables the network check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- api_compat: use griffe's API and ignore "attribute value changed", which flags refactored right-hand sides of instance attributes (ShapeAssociation.nodeSelector) rather than interface changes. Also fixes old-version loading: load_git must not get search_paths=".". - Dependency policy: pyshexc comes from a fork via [tool.uv.sources] until the EXTENDS grammar is released. Allow it by name on pull requests; the release workflow sets PYSHEX_RELEASE_CHECK=1 and refuses any non-PyPI runtime source, since wheels resolve from PyPI. - chardet is now imported (schema_loader's safe reader). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ericprud
force-pushed
the
compat-guardrails
branch
from
September 24, 2026 06:39
69bec03 to
ca23010
Compare
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.
LinkML asked that PyShEx releases not break compatibility, keep up with current Python versions, and not add unexpected heavyweight dependencies. This PR adds automated checks for all three.
What's added
tests/test_contractfreezes the public API: signatures, exports, CLI options and exit codes. It also replays the exact calls of the known PyPI clients, linkml and jupyter-rdfify 1.0.4. The tests are self-contained, so they also run against the built wheel.tests/test_policychecks the runtime dependency closure inuv.lockagainst an allowlist. It rejects version caps and requires imports to match declared dependencies. It keeps Python versions consistent across classifiers, the CI matrix and tox, and flags a CPython release left unsupported for more than 90 days..github/scripts/api_compat.pydiffs the API against the previous release with griffe. A break needs thebreaking-changelabel on the PR, or a major version bump at release (minor while 0.x).policyruns the pre-commit hooks and the API diff.downstreaminstalls this tree with the latest linkml and jupyter-rdfify in one resolution and runs their usage.python-nextis a non-blocking early warning for the next Python release.uvx pre-commit install.Fixes
master; it previously targetedmain, so pushes to master never ran CI.py314to toxenv_list.Findings not addressed here
codespell ''.{ ex:knows . * ; ex:knows . + }accepts a node with noex:knowstriples.After rebasing on #109 and #105
[tool.uv.sources]. The policy tests allow this by name on pull requests. The release workflow setsPYSHEX_RELEASE_CHECK=1, which refuses it, so nothing can be published until that pyshexc is on PyPI.🤖 Generated with Claude Code