Skip to content

Commit

Permalink
support 3.11 max,
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Orlovsky committed Sep 4, 2024
1 parent 04c8995 commit 2098a05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/lumigo_opentelemetry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ def auto_load(_: Any) -> None:
def init() -> Dict[str, Any]:
"""Initialize the Lumigo OpenTelemetry distribution."""
python_version = sys.version_info
print("python_version", python_version)

# Check if the major version is 3 and the minor version is between 8 and 12
if python_version.major != 3 or not (8 <= python_version.minor <= 12):
# Check if the major version is 3 and the minor version is between 8 and 11
if python_version.major != 3 or not (8 <= python_version.minor <= 11):
logger.warning(
f"Unsupported Python version {python_version.major}.{python_version.minor}; "
"only Python 3.8 to 3.12 are supported."
"only Python 3.8 to 3.11 are supported."
)
return {}

Expand Down
8 changes: 4 additions & 4 deletions src/test/unit/test_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_python_version_too_old(self):

self.assertEqual(result, {})
self.assertIn(
"Unsupported Python version 3.7; only Python 3.8 to 3.12 are supported.",
"Unsupported Python version 3.7; only Python 3.8 to 3.11 are supported.",
cm.output[0],
)

Expand All @@ -135,15 +135,15 @@ def test_python_version_supported(self):

@patch("sys.version_info", Mock())
def test_python_version_too_new(self):
# Mock version_info for Python 3.13
# Mock version_info for Python 3.12
sys.version_info.major = 3
sys.version_info.minor = 13
sys.version_info.minor = 12

with self.assertLogs("lumigo-opentelemetry", level="WARNING") as cm:
result = init()

self.assertEqual(result, {})
self.assertIn(
"Unsupported Python version 3.13; only Python 3.8 to 3.12 are supported.",
"Unsupported Python version 3.12; only Python 3.8 to 3.11 are supported.",
cm.output[0],
)

0 comments on commit 2098a05

Please sign in to comment.