fix: move keypoint shims to src/ and use warn_deprecated
- Move supervision/keypoint/ → src/supervision/keypoint/ so shims are included in built wheels (project uses src layout) - Replace raw DeprecationWarning with warn_deprecated (SupervisionWarnings) in all three shim files for consistent warning behaviour - Fix wrong import path (supervision.utils.deprecation → .internal) and remove unsupported stacklevel arg from warn_deprecated call [resolve #7] Review comment by @copilot (PR #2214): "This warning uses the standard DeprecationWarning..." [resolve #8] Review comment by @copilot (PR #2214): "These deprecation shim modules are added under the top-level supervision/..." --- Co-authored-by: Claude Code <noreply@anthropic.com>
This commit is contained in:
committed by
Jirka Borovec
co-authored by
Claude Code
parent
982c801db7
commit
f28874c0c2
@@ -1,9 +1,8 @@
|
||||
from supervision.utils.deprecation import warn_deprecated
|
||||
from supervision.utils.internal import warn_deprecated
|
||||
|
||||
warn_deprecated(
|
||||
"The 'supervision.keypoint' module is deprecated in `0.27.0` and will be removed "
|
||||
"in `0.30.0`. Please use 'supervision.key_points' instead.",
|
||||
stacklevel=2,
|
||||
"in `0.30.0`. Please use 'supervision.key_points' instead."
|
||||
)
|
||||
|
||||
from supervision.key_points.annotators import (
|
||||
@@ -0,0 +1,13 @@
|
||||
from supervision.utils.internal import warn_deprecated
|
||||
|
||||
warn_deprecated(
|
||||
"The 'supervision.keypoint' module is deprecated in `0.27.0` and will be removed "
|
||||
"in `0.30.0`. Please use 'supervision.key_points' instead."
|
||||
)
|
||||
|
||||
from supervision.key_points.annotators import ( # noqa: E402, F401
|
||||
BaseKeyPointAnnotator,
|
||||
EdgeAnnotator,
|
||||
VertexAnnotator,
|
||||
VertexLabelAnnotator,
|
||||
)
|
||||
@@ -0,0 +1,8 @@
|
||||
from supervision.utils.internal import warn_deprecated
|
||||
|
||||
warn_deprecated(
|
||||
"The 'supervision.keypoint' module is deprecated in `0.27.0` and will be removed "
|
||||
"in `0.30.0`. Please use 'supervision.key_points' instead."
|
||||
)
|
||||
|
||||
from supervision.key_points.core import KeyPoints # noqa: E402, F401
|
||||
@@ -1,15 +0,0 @@
|
||||
import warnings
|
||||
|
||||
warnings.warn(
|
||||
"The 'supervision.keypoint' module is deprecated in `0.27.0` and will be removed "
|
||||
"in `0.30.0`. Please use 'supervision.key_points' instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
from supervision.key_points.annotators import ( # noqa: F401, E402
|
||||
BaseKeyPointAnnotator,
|
||||
EdgeAnnotator,
|
||||
VertexAnnotator,
|
||||
VertexLabelAnnotator,
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
import warnings
|
||||
|
||||
warnings.warn(
|
||||
"The 'supervision.keypoint' module is deprecated in `0.27.0` and will be removed "
|
||||
"in `0.30.0`. Please use 'supervision.key_points' instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
from supervision.key_points.core import KeyPoints # noqa: F401, E402
|
||||
Reference in New Issue
Block a user