Centralize deprecation version markers in DeprecatedSince - #3444
Draft
deruyter92 wants to merge 5 commits into
Draft
Centralize deprecation version markers in DeprecatedSince#3444deruyter92 wants to merge 5 commits into
DeprecatedSince#3444deruyter92 wants to merge 5 commits into
Conversation
C-Achard
approved these changes
Aug 13, 2026
C-Achard
left a comment
Collaborator
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!
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
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
| class DeprecationRound(Enum): | ||
| """Collection of all deprecation rounds used in the deprecation markers - single source of truth.""" | ||
|
|
||
| PARAMETER_CONSISTENCY = DeprecationRoundInfo( |
Collaborator
There was a problem hiding this comment.
Another quick comment, we may want to think about disambiguation, I can foresee many times where we might need to deprecate for parameter consistency. Maybe some sort of year/month marker ?
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.
Summary
Add
DeprecatedSincetodeeplabcut/core/deprecation.py, holding one constant perround of deprecations, and points all 67 markers across 33 files at it:
@deprecated(replacement="deeplabcut.core.config.ProjectConfig", since=DeprecatedSince.CONFIG_MODEL_MIGRATION)Add a test that walks the package and fails on any remaining
since=orremoved_in=literal, so the single source of truth holds without relying on review.deprecation.pyis exempt: its docstrings illustrate the API with literal versions.