Skip to content

feat(diff): list used names deprecated at the target version (DT-CORE-62) - #23

Open
rise11hx-cmyk wants to merge 1 commit into
cschmertz:mainfrom
rise11hx-cmyk:feat/62-diff-deprecated-uses
Open

rise11hx-cmyk wants to merge 1 commit into
cschmertz:mainfrom
rise11hx-cmyk:feat/62-diff-deprecated-uses

Conversation

@rise11hx-cmyk

Copy link
Copy Markdown
Contributor

What this does

diff_versions with used_symbols used to report only deprecations that began inside the range, so a used name already deprecated before the range went unmentioned, and a deprecation that ended inside the range was still reported as one to act on (DT-CORE-62, #15).

Both halves are here, following your reply on the issue:

  1. deprecated_uses — every used path deprecated at to_version, wherever it began. Each item is path, deprecated_in (from _deprecation, so <=X when it is already there in the earliest indexed release) and message (UntrustedText, the library's own text). The state at each end comes from the _check_symbols result _unchecked_uses already asked for, so no name is checked twice, and a class whose deprecation sits on its __init__ reads deprecated as it does everywhere else.
  2. detail.until — on an in-range deprecated event whose deprecation no longer holds at to_version, the first release in the range where the name is still indexed but no longer deprecated. A removal isn't an end; its own event says that.

No existing field or kind changed, and events keeps its meaning ("what changed in this range").

Before / after, on the published index

uv run deptime index pull (53 packages, built 2026-11-19T04:57Z), then the three examples from the issue:

Command Before After
diff langgraph 1.0.2 1.2.20 --used langgraph.errors.NodeInterrupt events: [], no note, nothing about the name deprecated_uses: [{path: langgraph.errors.NodeInterrupt, deprecated_in: 0.6.0, message: "NodeInterrupt is deprecated. Please use \langgraph.types.interrupt` instead."}]`
diff huggingface_hub 0.32.2 0.23.2 --used huggingface_hub.Repository events: [], nothing deprecated_uses: [{path: huggingface_hub.Repository, deprecated_in: 0.19.0, message: "Repository is deprecated. ..."}]
diff gradio 3.23.0 6.31.0 --used gradio.update 3.45.0 deprecated "Using the update method is deprecated. ...", no end 3.45.0 deprecated with detail.until: 3.48.0; deprecated_uses: []

And check_symbols still answers the same states those lists are built from: langgraph 1.2.20 langgraph.errors.NodeInterrupt → present, deprecated; gradio 6.31.0 gradio.update → present, no deprecation.

Tests (red first, then green)

The new test is tests/test_query.py::test_diff_lists_used_names_deprecated_at_the_target_version, on its own synthetic index:

Run Command Result
Red git stash push -- src/deptime/models.py src/deptime/query.py, then uv run pytest -q tests/test_query.py -k deprecated_at_the_target AttributeError: 'DiffResult' object has no attribute 'deprecated_uses'
Green restore, same command 1 passed
Full suite uv run pytest 595 passed, 84 deselected (baseline before the change: 594 passed)
Format uv run ruff format src tests 1 file reformatted (the test), 57 unchanged
Lint uv run ruff check src tests All checks passed

The test covers: a deprecation that began before the range (<=0.1.0, listed), the same name going from deprecated to fine inside the range (event kept with until, not listed), a removal (no invented until), the range starting inside a deprecation (no start event, not listed), no used_symbols (empty), and a class whose deprecation sits on __init__ (listed with deprecated_in at the release it moved there).

Notes

  • uv.lock and the pulled .scratch-deptime/ index are not part of the commit; only the four files above changed.
  • No new dependency, no network in the tests, no LLM: the answers come from the index as before.
  • I left the CLI text alone: it prints the model's JSON, so the new field shows up there without a formatter change.

DT-CORE-62, closes #15.

diff_versions only reported deprecations that began inside the range, so a used name
deprecated before it went unmentioned, and one whose deprecation ended inside it was
reported as still deprecated.

- New DiffResult field `deprecated_uses`: every used path deprecated at `to_version`,
  with `deprecated_in` from the same walk check_upgrade uses (`<=X` when it began before
  the earliest indexed release) and the library's own text as untrusted `message`.
- The state at each end is read once, by the `_check_symbols` calls `_unchecked_uses`
  already made, so a class whose deprecation sits on its `__init__` counts too.
- An in-range `deprecated` event whose deprecation no longer holds at `to_version`
  carries `detail.until`, the first release where the name is indexed but not
  deprecated. A removal isn't an end: its own event says that.
- Test with a synthetic index covering both halves; CHANGELOG entry.

DT-CORE-62

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.

diff_versions: say when a used name is deprecated at the target version, not only when it became so

1 participant