Skip to content

Bump click and linkml floors for click 8.3 compat#230

Merged
amc-corey-cox merged 5 commits into
mainfrom
fix-click83
May 14, 2026
Merged

Bump click and linkml floors for click 8.3 compat#230
amc-corey-cox merged 5 commits into
mainfrom
fix-click83

Conversation

@amc-corey-cox
Copy link
Copy Markdown
Contributor

Closes #218.

Summary

  • Bumps click>=8.2 (which removed CliRunner(mix_stderr=...) in favour of always-separate stdout/stderr).
  • Bumps linkml>=1.11.0rc3 and linkml-runtime>=1.11.0rc3 (linkml 1.11 itself requires click>=8.2, so the floors move together).
  • Drops the now-removed mix_stderr=False kwarg from the four CliRunner fixtures.

Why the data-model change is in scope

linkml 1.11rc3 tightens validate-spec's structural validation, which surfaced a latent inconsistency in linkml-map's data model:

  • The runtime treats ClassDerivation.is_a / mixins as string name references (_class_derivation_ancestors in transformer/transformer.py calls _find_class_derivation_by_name(parent); schema_mapper.py assigns cd.is_a straight into ClassDefinition.is_a which is a string slot).
  • But the generated JSON Schema for is_a was anyOf: [{$ref: ElementDerivation}, null] — no string variant — because ElementDerivation had no identifier: true slot. linkml 1.10 didn't run this structural check; 1.11rc3 does, and rejects any string is_a: value.

Switching ElementDerivation.name from key: true to identifier: true matches linkml's own meta.yaml convention for Element (where name: identifier: true is the canonical pattern for schema elements) and lets the JSON Schema generator emit the string-reference variant. This brings the validator in line with how the runtime actually uses these slots.

Regenerated transformer_model.py via make. The only diff in the regenerated pydantic file is the metamodel_version bump (1.7.0 → 1.11.0) — no class-shape changes.

Other changes

  • tests/input/examples/personinfo_basic/transform/personinfo-to-agent.transform.yaml: added a description: to the previously empty Entity: derivation (cosmetic; not required after the data-model fix).
  • AGENTS.md: removed stale just references — the repo doesn't use just, only uv run … and make targets.

Lock file

The lock is refreshed against the prereleases (uv lock --upgrade-package linkml --upgrade-package linkml-runtime --upgrade-package click --prerelease=allow) so CI passes now. Plan: sit on this PR until linkml 1.11.0 GA, then uv lock again to move from rc3 → 1.11.0 final before merging.

Test plan

  • uv run pytest — 794 passed, 4 skipped locally
  • uv run pytest --doctest-modules src/linkml_map/ — 18 passed locally
  • uv run ruff check . and uv run ruff format --check . — clean locally
  • After linkml 1.11.0 ships: refresh lock to final release, re-run CI before merging

Bumps click>=8.2 (which removed the CliRunner mix_stderr kwarg in
favour of always-separate stdout/stderr) and linkml/linkml-runtime to
>=1.11.0rc3 (which requires click>=8.2 itself). Drops the now-removed
mix_stderr=False kwarg from the four CliRunner fixtures.

linkml 1.11rc3 also tightens validate-spec's structural validation,
which surfaced a latent data-model bug: ElementDerivation.is_a /
mixins are looked up by string name at runtime
(_find_class_derivation_by_name) but the generated JSON Schema
required an inline ElementDerivation object. Switching
ElementDerivation.name from key: true to identifier: true (matching
linkml's own meta.yaml convention for Element) lets schema generation
produce the string variant, aligning the validator with the runtime.

The lock pulls in linkml/linkml-runtime 1.11.0rc3 explicitly so CI is
green now; sit on the PR until 1.11.0 GA, then refresh the lock to
the final release.
Copilot AI review requested due to automatic review settings May 12, 2026 14:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates dependency minimums and related fixtures to stay compatible with newer click (8.3+) and linkml (1.11 validation behavior), and adjusts the LinkML-map transformer datamodel so validate-spec accepts the string-reference form the runtime already uses.

Changes:

  • Bump dependency floors (click>=8.2, linkml>=1.11.0rc3, linkml-runtime>=1.11.0rc3) and refresh uv.lock accordingly.
  • Remove the now-unsupported mix_stderr=False kwarg from CliRunner fixtures in CLI tests.
  • Update the transformer LinkML schema (ElementDerivation.name) to be an identifier, and bump the generated model’s metamodel_version.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Raises minimum dependency versions for click/linkml/linkml-runtime.
uv.lock Refreshes the resolved dependency set to include the new minimums/RCs.
tests/test_cli/test_cli.py Drops mix_stderr=False from CliRunner() fixture.
tests/test_cli/test_cli_validate.py Drops mix_stderr=False from CliRunner() fixture.
tests/test_cli/test_cli_multi_spec.py Drops mix_stderr=False from CliRunner() fixture.
tests/test_cli/test_cli_tabular.py Drops mix_stderr=False from CliRunner() fixture.
src/linkml_map/datamodel/transformer_model.yaml Changes ElementDerivation.name from key: true to identifier: true for LinkML 1.11 structural validation compatibility.
src/linkml_map/datamodel/transformer_model.py Regenerated; bumps metamodel_version to 1.11.0.
tests/input/examples/personinfo_basic/transform/personinfo-to-agent.transform.yaml Adds a description to the Entity derivation.
AGENTS.md Updates repo workflow notes to uv run … / make (removes stale just references).

Comment thread pyproject.toml Outdated
Copilot AI review requested due to automatic review settings May 14, 2026 12:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Comment thread pyproject.toml
Comment thread AGENTS.md Outdated
@amc-corey-cox
Copy link
Copy Markdown
Contributor Author

Final state

  • Floors: linkml>=1.11.0, linkml-runtime>=1.11.0 (GA, not rc3) and click>=8.2 — bumped in 7b4c0d5.
  • Lock: refreshed to linkml 1.11.0 / linkml-runtime 1.11.0 final.
  • Main caught up: merged main in 6d29212, picking up f2363c3, 4b449ad, c2584ec. PR diff against main is unchanged in scope.
  • Test plan results:
    • uv run pytest — 821 passed, 4 skipped
    • uv run pytest --doctest-modules src/linkml_map/ — 18 passed
    • uv run ruff check . and uv run ruff format --check . — clean
    • CI passing across the 3.10–3.13 matrix

Description body intentionally preserved as written for history; this comment reflects the shipped state.

@amc-corey-cox amc-corey-cox merged commit 8a35ba9 into main May 14, 2026
10 checks passed
@amc-corey-cox amc-corey-cox deleted the fix-click83 branch May 14, 2026 14:27
This was referenced May 14, 2026
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.

CliRunner(mix_stderr=False) will break under click 8.3+

2 participants