Skip to content

Commit e0ac1ff

Browse files
authored
feat: support Python 3.12 (#7)
1 parent 8945b1e commit e0ac1ff

File tree

11 files changed

+99
-17
lines changed

11 files changed

+99
-17
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @kenany
1+
* @crowdstrike/aidr-python-CS-Maintainers

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,32 @@ jobs:
107107

108108
- name: ruff format
109109
run: uv run ruff format --check .
110+
111+
test:
112+
runs-on: ubuntu-24.04
113+
strategy:
114+
fail-fast: false
115+
matrix:
116+
python-version: ["3.12", "3.13"]
117+
steps:
118+
- name: Checkout code
119+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
120+
121+
- run: npm install -g corepack
122+
- run: corepack enable pnpm
123+
124+
- name: Install uv
125+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
126+
with:
127+
enable-cache: true
128+
129+
- name: Setup Python
130+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
131+
with:
132+
python-version: ${{ matrix.python-version }}
133+
134+
- name: Install dependencies
135+
run: uv sync --all-extras --dev
136+
137+
- name: Test
138+
run: ./scripts/test

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13
1+
3.12

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pip install crowdstrike-aidr
1010

1111
## Requirements
1212

13-
Python v3.13 or greater.
13+
Python v3.12 or greater.
1414

1515
## Usage
1616

flake.lock

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

flake.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
shell = {pkgs ? import <nixpkgs>}:
1616
pkgs.mkShellNoCC {
1717
packages = with pkgs; [
18-
python313
18+
pnpm
19+
python312
1920
uv
2021
];
2122

2223
env = {};
2324

24-
shellHook = '''';
25+
shellHook = ''
26+
uv sync --all-extras --dev
27+
'';
2528
};
2629
};
2730
}

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ authors = [
1010
classifiers = [
1111
"Typing :: Typed",
1212
"Intended Audience :: Developers",
13+
"Programming Language :: Python :: 3.12",
1314
"Programming Language :: Python :: 3.13",
1415
"Programming Language :: Python :: 3.14",
1516
"Operating System :: OS Independent",
@@ -21,7 +22,7 @@ classifiers = [
2122
"License :: OSI Approved :: Apache Software License"
2223
]
2324

24-
requires-python = ">=3.13"
25+
requires-python = ">=3.12"
2526

2627
dependencies = [
2728
"httpx ~=0.28.1",
@@ -42,7 +43,7 @@ requires = ["uv_build ==0.9.13"]
4243
build-backend = "uv_build"
4344

4445
[tool.mypy]
45-
python_version = "3.13"
46+
python_version = "3.12"
4647
color_output = true
4748
error_summary = true
4849
implicit_reexport = false
@@ -58,7 +59,7 @@ warn_required_dynamic_aliases = true
5859

5960
[tool.ruff]
6061
line-length = 120
61-
target-version = "py313"
62+
target-version = "py312"
6263

6364
[tool.ruff.lint]
6465
select = [

scripts/test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ pnpx start-server-and-test --expect 404 \
88
"pnpx @stoplight/prism-cli mock -d --json-schema-faker-fillProperties=false ./specs/ai-guard.openapi.json" \
99
4010 \
1010
"uv run pytest tests/test_ai_guard.py"
11-

src/crowdstrike_aidr/_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
import typing
44
from collections.abc import Mapping
5-
from typing import Annotated, Any, TypeGuard, TypeIs, Union, cast, get_args, get_origin, overload
5+
from typing import Annotated, Any, TypeGuard, Union, cast, get_args, get_origin, overload
66

77
import typing_extensions
8+
from typing_extensions import TypeIs
89

910
from ._types import NotGiven, Omit
1011

tests/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import traceback
44
import typing
55
from datetime import datetime
6-
from typing import TYPE_CHECKING, Any, Literal, TypeGuard, TypeIs, TypeVar, assert_type, cast, get_origin
6+
from typing import TYPE_CHECKING, Any, Literal, TypeGuard, TypeVar, assert_type, cast, get_origin
77

88
import typing_extensions
99
from pydantic import AwareDatetime, BaseModel
1010
from pydantic.v1.typing import get_args, is_union
11+
from typing_extensions import TypeIs
1112

1213
from crowdstrike_aidr._utils import extract_type_arg, is_annotated_type
1314

0 commit comments

Comments
 (0)