Skip to content

build: upgrade ty to 0.0.114 - #184

Open
simontaurus wants to merge 4 commits into
mainfrom
build/ty-upgrade
Open

simontaurus wants to merge 4 commits into
mainfrom
build/ty-upgrade

Conversation

@simontaurus

@simontaurus simontaurus commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

ty>=0.0.24 was never a pin; the lock froze 0.0.49 at the June uv migration and every release's plain uv lock preserved it. This re-locks to 0.0.114 and adapts the config.

Changes:

  • [tool.ty.rules] renamed: invalid-return-type -> invalid-explicit-return, invalid-method-override -> incompatible-method-override, call-non-callable -> not-callable; unresolved-attribute split upstream into missing-attribute + missing-union-attribute, both kept at the old severities (rules section and the tests/typing/** override)
  • inline # ty: ignore[unresolved-import] -> [import-not-found] (3 sites)
  • incompatible-attribute-override downgraded with rationale: pydantic v1 configuration is a Config class override by design
  • an examples/** override keeps unused-type-ignore-comment quiet: the one blanket ignore there is load-bearing for downstream checker configs where the silenced rule runs

What the new rules found, fixed rather than silenced:

  • legacy model_validate({...}) called super().model_validate without returning it and fell off the end - it answered None for every dict payload; v1 parse_obj had the same fall-off for unmatched input (src/oold/model/__init__.py, src/oold/model/v1/__init__.py)
  • the v1 descriptor's __iris__ getter-only override silently dropped the mixin's setter; direct property assignment now delegates like __setattr__ already did (src/oold/model/v1/_descriptor.py)
  • from_json overrides renamed the abstract base's json_dict parameter to data; the base now matches, so a keyword call cannot break on an override
  • the document stores narrowed the base's format: LinkedDataFormat | None to a mutable LinkedDataFormat; widened to match

One claim from #183 corrected in the docs: attribute writes through Optional[Link[T]] type only under pyright. ty does not apply __set__ inside a union on 0.0.49 or 0.0.107 (0.0.107 rejects even = None), so the typing probe asserts the constructor direction and the docs say so instead of calling it version-dependent.

1403 passed under the descriptor binding, 1387 under OOLD_DESCRIPTOR_BINDING=0; ty check 0 diagnostics. ty now exits 1 on warnings, so the deprecated @contextmanager annotations (validation.pipeline, agent.client) are fixed and unsupported-base is ignored only in the dual-binding files, whose union-typed base is their point; ruff, deptry, strict docs build clean.

- rename the configured rules; unresolved-attribute split into
  missing-attribute and missing-union-attribute
- fix what the new rules found: legacy model_validate({...}) and
  v1 parse_obj fell off the end and answered None; the v1 descriptor
  __iris__ override dropped the mixin's setter; from_json overrides
  renamed the base's parameter; document-store format narrowed the base
- examples keep their blanket type: ignore for foreign checker configs
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Release preview

No version bump from the current commits (stays at v2.4.0). Use conventional commit types (feat, fix, ...) to trigger a release.

Changelog preview (truncated)

Preview via python-semantic-release and conventional commits.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Click to see benchmark comparison
📊 Benchmark Comparison (threshold: 1.3x)
============================================================

➖ Unchanged (within threshold):
  ➖ test_simple_dict_document_store: 0.0012s → 0.0012s (-0.2%)
  ➖ test_sqlite_document_store: 0.0013s → 0.0013s (-0.5%)
  ➖ test_local_sparql_store: 0.0273s → 0.0268s (-1.9%)
  ➖ test_oneof_subschema: 0.0403s → 0.0403s (+0.1%)
  ➖ test_enum_docstrings: 0.0337s → 0.0342s (+1.5%)
  ➖ test_subclass_inheritance: 0.0364s → 0.0371s (+1.9%)
  ➖ test_class_hierarchy: 0.0342s → 0.0340s (-0.7%)
  ➖ test_core[v1]: 0.0243s → 0.0246s (+1.3%)
  ➖ test_core[v2]: 0.0289s → 0.0288s (-0.3%)
  ➖ test_schema_generation[v1]: 0.0013s → 0.0013s (-0.1%)
  ➖ test_schema_generation[v2]: 0.0025s → 0.0025s (-0.6%)
  ➖ test_simple_json: 0.0005s → 0.0005s (-0.5%)
  ➖ test_complex_graph: 0.0011s → 0.0011s (+3.6%)

============================================================
Summary: 0 regressions, 0 improvements, 13 unchanged
============================================================

✅ No significant performance regressions

Threshold: 1.3x (30% slower triggers a regression warning)

Note: Benchmarks are informational only and won't fail the build.

💡 Tip: Download the benchmark-results artifact for detailed JSON data

- fix the deprecated contextmanager annotation in validation.pipeline
- scope an unsupported-base ignore to the dual-binding files, whose
  union-typed base is the point of those files
- main moved under the branch; re-lock picked up 0.0.114
- oold.agent.client had the deprecated Iterator return on @contextmanager
- notation_example docstring: requiredness follows the annotation
@simontaurus simontaurus changed the title build: upgrade ty to 0.0.107 build: upgrade ty to 0.0.114 Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Click to see benchmark comparison
📊 Benchmark Comparison (threshold: 1.3x)
============================================================

➖ Unchanged (within threshold):
  ➖ test_simple_dict_document_store: 0.0010s → 0.0011s (+0.9%)
  ➖ test_sqlite_document_store: 0.0011s → 0.0011s (-0.1%)
  ➖ test_local_sparql_store: 0.0220s → 0.0217s (-1.4%)
  ➖ test_oneof_subschema: 0.0345s → 0.0352s (+2.0%)
  ➖ test_enum_docstrings: 0.0293s → 0.0296s (+0.8%)
  ➖ test_subclass_inheritance: 0.0312s → 0.0314s (+0.7%)
  ➖ test_class_hierarchy: 0.0294s → 0.0299s (+1.9%)
  ➖ test_core[v1]: 0.0204s → 0.0208s (+2.0%)
  ➖ test_core[v2]: 0.0242s → 0.0245s (+1.4%)
  ➖ test_schema_generation[v1]: 0.0011s → 0.0011s (-0.2%)
  ➖ test_schema_generation[v2]: 0.0022s → 0.0022s (+0.5%)
  ➖ test_simple_json: 0.0004s → 0.0004s (-1.0%)
  ➖ test_complex_graph: 0.0009s → 0.0010s (+0.7%)

============================================================
Summary: 0 regressions, 0 improvements, 13 unchanged
============================================================

✅ No significant performance regressions

Threshold: 1.3x (30% slower triggers a regression warning)

Note: Benchmarks are informational only and won't fail the build.

💡 Tip: Download the benchmark-results artifact for detailed JSON data

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/oold/model/__init__.py 0.0% 1 Missing ⚠️
src/oold/model/v1/__init__.py 66.6% 1 Missing ⚠️
src/oold/model/v1/_descriptor.py 66.6% 1 Missing ⚠️
src/oold/utils/environment.py 0.0% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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