Repository navigation
Centralize deprecation version markers in DeprecatedSince - #3444
Merged
deruyter92 merged 7 commits intoAug 20, 2026
Merged
Conversation
C-Achard
approved these changes
Aug 13, 2026
C-Achard
left a comment
Member
There was a problem hiding this comment.
A few comments, note that the suggestions for additional dataclasses only matter if we want some sort of fancy automated ingestion, for maintaining it is likely redundant.
Feel free to cherry pick what you like and ignore the rest!
deruyter92
force-pushed
the
jaap/deprecation-versions-constants
branch
from
August 13, 2026 14:17
4e6f30b to
3c819f4
Compare
Collaborator
Author
|
@C-Achard Applied all your suggestions, thanks for the review. Note, I've rebased the PR to make it better reviewable (and fixed the commit messages). |
C-Achard
reviewed
Aug 14, 2026
deruyter92
marked this pull request as ready for review
August 19, 2026 09:08
deruyter92
force-pushed
the
jaap/deprecation-versions-constants
branch
from
August 19, 2026 16:07
b8a1119 to
335b8d5
Compare
Base automatically changed from
jaap/remove-rst-files
to
jaap/prepare_tf_deprecation
August 20, 2026 14:29
add test keeping version literals out of deprecation markers Walks the shipped package and fails on any since= or removed_in= literal, so DeprecatedSince stays the single source of truth. deprecation.py is exempt: its docstrings illustrate the API with literal versions. Also checks that every constant parses as a version.
Every @deprecated and @renamed_parameter marker spelled its version inline, so a round of deprecations could only be retargeted by grepping for version strings across the codebase. That is how the 3.1 -> 3.0.1 sweep in #3422 missed analyze_time_lapse_frames, and it makes it easy to move an unrelated API while retargeting one round. DeprecatedSince now holds one constant per round, named after the migration rather than its version so a retargeted round keeps its name, and annotated with the PR that introduced it. All 67 markers reference it.
…eprecationRound Enum
Fix incorrect deprecation description PRETRAINED_PROJECT_MIGRATION, which listed the wrong version for `since`. Merge into more descriptive name, relating to the TF deprecation (which is the main motivation).
…SING A more descriptive name was needed to avoid ambiguity with next follow-up parameter consistency migrations. This refers to the initial PR that introduced the aliasing system and DeprecationWarnings
deruyter92
force-pushed
the
jaap/deprecation-versions-constants
branch
from
August 20, 2026 14:53
f3489a8 to
c157f0a
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.
Motivation
PR #3332 introduced a deprecation system for deprecated functions and parameter aliasing. Although this significantly centralized things, the actual decorators markering the deprecations are now spread throughout the codebase and the
sinceparameter is redefined on every occurrence, making mistakes easy.This PR centralizes the administration in a single
DeprecationRoundenum, that serves as the single source of truth, and references the specific deprecation rounds and corresponding pull requests.Example usage
DeprecationRoundenumdeprecation_roundChanges
DeprecationRoundenum andDeprecationRoundInfoschema, listing existing deprecation rounds