From a23110f76b3b9f47c3f60c9b631797ba013004bf Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 30 Dec 2023 17:58:12 -0500 Subject: [PATCH] Remove sensor namespace redirection --- phoenix5/__init__.py | 17 ----------------- tests/test_sensors.py | 7 ------- 2 files changed, 24 deletions(-) diff --git a/phoenix5/__init__.py b/phoenix5/__init__.py index ab29932..90ad3e0 100644 --- a/phoenix5/__init__.py +++ b/phoenix5/__init__.py @@ -196,20 +196,3 @@ from .version import version as __version__ - - -# backwards compat -# TODO: remove in 2024 -def __getattr__(name): - if name != "sensors": - from .sensors import __all__ as sensors_all - - if name in sensors_all: - import warnings - from . import sensors - - message = f"{__name__}.{name} has moved to {__name__}.sensors" - warnings.warn(message, FutureWarning, stacklevel=2) - return getattr(sensors, name) - - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/tests/test_sensors.py b/tests/test_sensors.py index bf92817..09fa76d 100644 --- a/tests/test_sensors.py +++ b/tests/test_sensors.py @@ -6,10 +6,3 @@ def test_cancoder(): enc = phoenix5.sensors.CANCoder(0) enc.getPosition() - - -def test_deprecated_import(): - with pytest.warns(FutureWarning, match="moved"): - from phoenix5 import CANCoder - - assert CANCoder is phoenix5.sensors.CANCoder