From 3ec9a3921cdaf2a0f4316f02d9fb5c0b30ccf879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Badenes?= Date: Tue, 26 May 2026 10:23:33 -0300 Subject: [PATCH] Remove deprecated APIs ahead of v3 major release Remove `with_counter_metric_async()` (deprecated in v2.0.2) and `RobotSessionPool.register_command_callback()` (deprecated in v1.7.2). Both had zero production callers. Also removes the `deprecated` package dependency since no other code imports it. Co-Authored-By: Claude Opus 4.6 --- inorbit_edge/metrics.py | 16 ---------------- inorbit_edge/robot.py | 9 --------- inorbit_edge/tests/test_metrics.py | 17 ----------------- requirements.txt | 1 - 4 files changed, 43 deletions(-) diff --git a/inorbit_edge/metrics.py b/inorbit_edge/metrics.py index 3e33c77..e79904b 100644 --- a/inorbit_edge/metrics.py +++ b/inorbit_edge/metrics.py @@ -40,8 +40,6 @@ import logging import re -from deprecated import deprecated - logger = logging.getLogger(__name__) @@ -302,17 +300,3 @@ def sync_wrapper(*args, **kwargs): return sync_wrapper return decorator - - -@deprecated( - version="2.0.2", - reason=("use with_counter_metric(), which now auto-detects async functions"), -) -def with_counter_metric_async(metric): - """Deprecated alias for :func:`with_counter_metric`. - - Prefer ``@with_counter_metric(...)``, which now detects async functions - automatically. - """ - - return with_counter_metric(metric) diff --git a/inorbit_edge/robot.py b/inorbit_edge/robot.py index f9104a8..eb0dafb 100644 --- a/inorbit_edge/robot.py +++ b/inorbit_edge/robot.py @@ -67,7 +67,6 @@ import certifi import subprocess import re -from deprecated import deprecated INORBIT_CLOUD_SDK_ROBOT_CONFIG_URL = "https://control.inorbit.ai/cloud_sdk_robot_config" INORBIT_REST_API_URL = "https://api.inorbit.ai" @@ -1848,11 +1847,3 @@ def free_robot_session(self, robot_id): sess = self.get_session(robot_id) sess.disconnect() del self.robot_sessions[robot_id] - - @deprecated( - version="1.7.2", - reason="use RobotSessionFactory.register_command_callback() instead", - ) - def register_command_callback(self, callback): - """Registers a callback to be called when a command is received""" - self.robot_session_factory.register_command_callback(callback) diff --git a/inorbit_edge/tests/test_metrics.py b/inorbit_edge/tests/test_metrics.py index 8f85d8a..004d396 100644 --- a/inorbit_edge/tests/test_metrics.py +++ b/inorbit_edge/tests/test_metrics.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: MIT import asyncio -import warnings import pytest @@ -80,22 +79,6 @@ def f(): assert counter.calls == [(1, {})] -def test_with_counter_metric_async_alias_emits_deprecation_warning(): - counter = _RecordingCounter() - - with warnings.catch_warnings(record=True) as captured: - warnings.simplefilter("always") - - @edge_metrics.with_counter_metric_async(counter) - async def f(): - return 1 - - asyncio.run(f()) - - assert any(issubclass(w.category, DeprecationWarning) for w in captured) - assert counter.calls == [(1, {})] - - def test_wrapped_function_preserves_name_and_docstring(): counter = _RecordingCounter() diff --git a/requirements.txt b/requirements.txt index 8482288..40359a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,5 +6,4 @@ pydantic>=2.6,<3.0 pysocks>=1.7,<2.0 protobuf~=5.29.6 certifi>=2024.2 -deprecated>=1.2,<2.0 rdp2~=1.1.2