Skip to content

Commit 3533587

Browse files
authored
fix: Remove packaging library (#1816)
* Remove packaging library * Updated tests setup
1 parent 58b8aad commit 3533587

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

workers/proxy_worker/dispatcher.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from typing import Any, Optional
1515

1616
import grpc
17-
from packaging.version import Version
1817

1918
from proxy_worker import protos
2019
from proxy_worker.logging import (
@@ -102,8 +101,7 @@ def get_global_current_invocation_id() -> Optional[str]:
102101
def get_current_invocation_id() -> Optional[Any]:
103102
global _library_worker
104103
# Check global current invocation first (most up-to-date)
105-
if (_library_worker
106-
and Version(_library_worker.version.VERSION) < Version("1.1.0b4")):
104+
if _library_worker and not hasattr(_library_worker, 'invocation_id_cv'):
107105
global_invocation_id = get_global_current_invocation_id()
108106
if global_invocation_id is not None:
109107
return global_invocation_id

workers/tests/unittest_proxy/test_dispatcher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ def setUp(self):
412412
with dispatcher_module._current_invocation_lock:
413413
dispatcher_module._current_invocation_id = None
414414

415+
# Clear library worker to ensure tests run with expected state
416+
dispatcher_module._library_worker = None
417+
415418
def tearDown(self):
416419
"""Clean up after each test"""
417420
# Import the module-level variables properly
@@ -425,6 +428,9 @@ def tearDown(self):
425428
with dispatcher_module._current_invocation_lock:
426429
dispatcher_module._current_invocation_id = None
427430

431+
# Clear library worker
432+
dispatcher_module._library_worker = None
433+
428434
def test_global_invocation_id_set_and_get(self):
429435
"""Test setting and getting global current invocation ID"""
430436
test_id = "test-invocation-123"

0 commit comments

Comments
 (0)