Skip to content

feat(diff): say which used names are deprecated where you're going (DT-CORE-62) - #24

Closed
rise11hx-cmyk wants to merge 1 commit into
cschmertz:mainfrom
rise11hx-cmyk:fix/15-deprecated-uses
Closed

rise11hx-cmyk wants to merge 1 commit into
cschmertz:mainfrom
rise11hx-cmyk:fix/15-deprecated-uses

Conversation

@rise11hx-cmyk

Copy link
Copy Markdown
Contributor

Closes #15.

diff_versions with used_symbols answers about a range, but what a reader acts on is the state at to_version. A used path already deprecated there is now listed in deprecated_uses, next to never_seen and unchecked_uses, with deprecated_in and the library's message, wherever the deprecation began. A deprecated event inside the range stays as it is, and carries detail.until — the first release where the name is still there but no longer deprecated — when the deprecation ends before to_version. A removal isn't an end: it has its own event.

The four cases, on the index

langgraph.errors.NodeInterrupt, 1.0.2 -> 1.2.20 (deprecated from 0.6.0, no event in the range):

"deprecated_uses": [
  {
    "path": "langgraph.errors.NodeInterrupt",
    "deprecated_in": "0.6.0",
    "message": "NodeInterrupt is deprecated. Please use [`interrupt`][langgraph.types.interrupt] instead."
  }
]

huggingface_hub.Repository, 0.32.2 -> 0.23.2 (both ends deprecated; the text moved from the class to its own __init__ at 0.20, and _check_symbols already reads that as the class's):

"deprecated_uses": [
  {
    "path": "huggingface_hub.Repository",
    "deprecated_in": "0.19.0",
    "message": "Repository is deprecated. Please prefer the http-based alternatives instead. Given its large adoption in legacy code, the complete removal is only planned on next major release. For more details, please read https://huggingface.co/docs/huggingface_hub/concepts/git_vs_http."
  }
]

gradio.update, 3.23.0 -> 6.31.0 (deprecated at 3.45.0, no longer deprecated at 3.48.0): not listed, and the event says where it ended.

gradio.update at 3.45.0 until=3.48.0

Shape

  • _unchecked_uses and _deprecated_uses now read the same _check_symbols result at each end of the range, taken once per used path instead of twice.
  • detail.until is computed at answer time (_deprecation_until), so no ingest change and no new index format; it reads a class's __init__ deprecation as the class's, and skips releases where the name is gone.
  • The note gains a sentence for the field, like its neighbours.

Gates

  • Red first: with models.py/query.py reverted and the two new tests kept, AttributeError: 'DiffResult' object has no attribute 'deprecated_uses'; with the code, both pass.
  • ruff format --check / ruff check clean; full suite 592 passed, with only the two tests that need git on this Windows box failing for a missing shell (COMSPEC), as they did before this branch.
  • bench/curated_check.py: 401 hints, 0 problems.

diff_versions answers with used_symbols, so it should answer for the version the code is going to: a path
already deprecated there is listed in deprecated_uses with deprecated_in and the library's message, wherever
the deprecation began. A deprecated event inside the range stays, and says when the deprecation ended in
detail.until; a removal doesn't count as an end, it has its own event (DT-CORE-62).
@rise11hx-cmyk

Copy link
Copy Markdown
Contributor Author

"A parallel run of mine opened #23 for the same issue while this branch was in flight, so this one is a duplicate: closing it to leave one PR on #15. Everything below is in #23 as well, including both halves of your reply and the three index cases.\n\nThe only extra here is documentation, not behaviour, and #23 can take it in a follow-up if you want it: a diff_versions bullet in docs/03-product-spec.md, a sentence in used_symbols' MCP description naming deprecated_uses, and DT-CORE-62 moved into BACKLOG.md's Done list.\n\nSorry for the noise."

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