Skip to content

Commit 2c00ee6

Browse files
committed
Add support for Python 3.15
1 parent e70fdfb commit 2c00ee6

9 files changed

Lines changed: 1274 additions & 299 deletions

File tree

‎.github/ISSUE_TEMPLATE/bug_report.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ What actually happened (include logs or error messages if possible).
2323

2424
**Environment**
2525
- OS: [e.g. Ubuntu 22.04, macOS 15.0, Windows 11]
26-
- Language version: [e.g. 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14]
26+
- Language version: [e.g. 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14, 3.15]
2727
- Framework: [e.g. Django, Flask, FastAPI]
2828
- Environment: [local, Docker, cloud, etc.]
2929
- Aikido Package version: [e.g. 1.2.3]

‎.github/workflows/unit-test.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
# Don't cancel jobs if one fails
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -84,4 +84,5 @@ jobs:
8484
coverage-reports/coverage-3.11/lcov.info
8585
coverage-reports/coverage-3.12/lcov.info
8686
coverage-reports/coverage-3.13/lcov.info
87-
coverage-reports/coverage-3.14/lcov.info
87+
coverage-reports/coverage-3.14/lcov.info
88+
coverage-reports/coverage-3.15/lcov.info

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Zen instruments the following AI SDKs to track which models are used and how man
6464
* ✅ [`boto3`](https://pypi.org/project/boto3) (AWS Bedrock)
6565
* ✅ [`groq`](https://pypi.org/project/groq)
6666

67-
Zen is compatible with Python 3.8-3.14 and can run on Windows, Linux, and Mac OS X.
67+
Zen is compatible with Python 3.8-3.15 and can run on Windows, Linux, and Mac OS X.
6868

6969
## Installation
7070

‎aikido_zen/helpers/python_version_not_supported.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def python_version_not_supported() -> bool:
88
if major != 3:
99
logger.error("This version of Zen only supports Python 3")
1010
return True
11-
if minor > 14:
12-
logger.error("This version of Zen doesn't support versions above Python 3.14")
11+
if minor > 15:
12+
logger.error("This version of Zen doesn't support versions above Python 3.15")
1313
return True
1414
return False

‎aikido_zen/helpers/python_version_not_supported_test.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
)
66

77

8-
def test_python_3_14_is_supported(monkeypatch):
8+
def test_python_3_15_is_supported(monkeypatch):
99
monkeypatch.setattr(
1010
"aikido_zen.helpers.python_version_not_supported.sys.version_info",
11-
SimpleNamespace(major=3, minor=14),
11+
SimpleNamespace(major=3, minor=15),
1212
)
1313

1414
assert python_version_not_supported() is False
1515

1616

17-
def test_python_3_15_is_not_supported(monkeypatch, caplog):
17+
def test_python_3_16_is_not_supported(monkeypatch, caplog):
1818
monkeypatch.setattr(
1919
"aikido_zen.helpers.python_version_not_supported.sys.version_info",
20-
SimpleNamespace(major=3, minor=15),
20+
SimpleNamespace(major=3, minor=16),
2121
)
2222

2323
assert python_version_not_supported() is True
24-
assert "doesn't support versions above Python 3.14" in caplog.text
24+
assert "doesn't support versions above Python 3.15" in caplog.text
2525

2626

2727
def test_non_python_3_version_is_not_supported(monkeypatch, caplog):

‎aikido_zen/sinks/builtins_import.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ def _import(func, instance, args, kwargs, return_value):
1515
if not hasattr(return_value, "__package__"):
1616
return
1717

18+
if running_import_scan.get():
19+
return # Outside the try: its finally would reset the outer scan's flag
20+
1821
try:
19-
if running_import_scan.get():
20-
return
2122
running_import_scan.set(True)
2223

2324
name = getattr(return_value, "__package__")

‎aikido_zen/sinks/tests/builtins_import_test.py‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import importlib.metadata
2+
13
import pytest
24

35
import aikido_zen
@@ -54,3 +56,35 @@ def recursive_add_package(name, version):
5456

5557
# Restore the original method after the test
5658
monkeypatch.undo()
59+
60+
61+
def test_imports_during_scan_do_not_start_nested_scans(monkeypatch):
62+
running = []
63+
nested = []
64+
original_version = importlib.metadata.version
65+
66+
def version_that_imports(name):
67+
if running:
68+
nested.append(name)
69+
running.append(name)
70+
try:
71+
import pytest
72+
import packaging
73+
74+
return original_version(name)
75+
finally:
76+
running.pop()
77+
78+
seen = set()
79+
80+
def get_package_once(name):
81+
if name in seen:
82+
return {"name": name}
83+
seen.add(name)
84+
85+
monkeypatch.setattr(PackagesStore, "get_package", get_package_once)
86+
monkeypatch.setattr(importlib.metadata, "version", version_that_imports)
87+
88+
import flask
89+
90+
assert nested == []

‎poetry.lock‎

Lines changed: 1223 additions & 285 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ classifiers = [
4949
"Programming Language :: Python :: 3.12",
5050
"Programming Language :: Python :: 3.13",
5151
"Programming Language :: Python :: 3.14",
52+
"Programming Language :: Python :: 3.15",
5253
"Programming Language :: Python :: 3 :: Only",
5354
"Topic :: Security",
5455
]
@@ -61,7 +62,7 @@ homepage = "https://www.aikido.dev/runtime/firewall/"
6162
"Bug Bounty" = "https://app.intigriti.com/programs/aikido"
6263

6364
[tool.poetry.dependencies]
64-
python = ">=3.8,<3.15"
65+
python = ">=3.8,<3.16"
6566
regex = [
6667
{ version = "^2024.5.15", python = "<3.13" },
6768
{ version = "^2026.8.31", python = ">=3.13" },

0 commit comments

Comments
 (0)