Skip to content

Commit 7d39204

Browse files
deps: upgrade to python 3.13 (#6645)
1 parent 86e3f91 commit 7d39204

File tree

8 files changed

+171
-420
lines changed

8 files changed

+171
-420
lines changed

.github/workflows/api-pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
name: API Unit Tests
3535

3636
strategy:
37-
max-parallel: 2
37+
max-parallel: 3
3838
matrix:
39-
python-version: ["3.11", "3.12"]
39+
python-version: ["3.11", "3.12", "3.13"]
4040

4141
steps:
4242
- name: Cloning repo

.github/workflows/api-run-makefile-target.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- uses: actions/setup-python@v5
4040
with:
41-
python-version: 3.11
41+
python-version: 3.13
4242
cache: poetry
4343

4444
- name: Install Dependencies

.github/workflows/api-tests-with-private-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
name: API Unit Tests
3232

3333
strategy:
34-
max-parallel: 2
34+
max-parallel: 3
3535
matrix:
36-
python-version: ["3.11", "3.12"]
36+
python-version: ["3.11", "3.12", "3.13"]
3737

3838
steps:
3939
- name: Cloning repo

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ARG CI_COMMIT_SHA=dev
5353

5454
# Pin runtimes versions
5555
ARG NODE_VERSION=22
56-
ARG PYTHON_VERSION=3.11
56+
ARG PYTHON_VERSION=3.13
5757

5858
FROM public.ecr.aws/docker/library/node:${NODE_VERSION}-bookworm AS node
5959
FROM cgr.dev/chainguard/wolfi-base:latest AS wolfi-base

api/poetry.lock

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

api/pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ version = "2.68.0"
99
description = "The API component for the Flagsmith application."
1010
authors = [{ name = "Flagsmith", email = "[email protected]" }]
1111
readme = "readme.md"
12-
requires-python = ">=3.11, <3.13"
12+
requires-python = ">=3.11, <3.14"
1313
dynamic = ["dependencies"]
1414

1515
[tool.ruff]
1616
line-length = 88
1717
indent-width = 4
18-
target-version = "py311"
18+
target-version = "py313"
1919
extend-exclude = ["migrations"]
2020

2121
[tool.ruff.format]
@@ -100,8 +100,11 @@ django_settings_module = "app.settings.local"
100100
[tool.drf-stubs]
101101
enabled = true
102102

103+
[tool.poetry]
104+
package-mode = false
105+
103106
[tool.poetry.dependencies]
104-
python = ">3.11,<3.13"
107+
python = ">3.11,<3.14"
105108
django = ">=5,<6"
106109
rudder-sdk-python = "~2.0.2"
107110
segment-analytics-python = "~2.2.3"

api/tests/unit/app_analytics/test_unit_app_analytics_cache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_api_usage_cache(
4343
assert not mocked_track_request_task.called
4444

4545
# Now, let's move the time forward
46-
frozen_time.tick(settings.API_USAGE_CACHE_SECONDS + 1) # type: ignore[arg-type]
46+
frozen_time.tick(settings.API_USAGE_CACHE_SECONDS + 1)
4747

4848
# let's track another request(to trigger flush)
4949
cache.track_request(
@@ -136,7 +136,7 @@ def test_feature_evaluation_cache(
136136
)
137137

138138
# Now, let's move the time forward
139-
frozen_time.tick(settings.FEATURE_EVALUATION_CACHE_SECONDS + 1) # type: ignore[arg-type]
139+
frozen_time.tick(settings.FEATURE_EVALUATION_CACHE_SECONDS + 1)
140140

141141
# track another evaluation(to trigger cache flush)
142142
cache.track_feature_evaluation(
@@ -154,7 +154,7 @@ def test_feature_evaluation_cache(
154154
)
155155

156156
# move time forward again
157-
frozen_time.tick(settings.FEATURE_EVALUATION_CACHE_SECONDS + 1) # type: ignore[arg-type]
157+
frozen_time.tick(settings.FEATURE_EVALUATION_CACHE_SECONDS + 1)
158158

159159
# track another one(to trigger cache flush)
160160
cache.track_feature_evaluation(

api/tests/unit/util/test_logging.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from util.logging import GunicornAccessLogJsonFormatter, JsonFormatter
1212

1313

14-
@pytest.mark.freeze_time("2023-12-08T06:05:47.320000+00:00")
14+
@pytest.mark.freeze_time("2023-12-08T06:05:47.000000+00:00")
1515
def test_json_formatter__outputs_expected(
1616
inspecting_handler: logging.Handler,
1717
request: pytest.FixtureRequest,
@@ -48,15 +48,15 @@ def _log_traceback() -> None:
4848
{
4949
"levelname": "INFO",
5050
"message": "hello arg1, 22",
51-
"timestamp": "2023-12-08 06:05:47,319",
51+
"timestamp": "2023-12-08 06:05:47,000",
5252
"logger_name": "test_json_formatter__outputs_expected",
5353
"process_id": expected_pid,
5454
"thread_name": "MainThread",
5555
},
5656
{
5757
"levelname": "ERROR",
5858
"message": "this is an error",
59-
"timestamp": "2023-12-08 06:05:47,319",
59+
"timestamp": "2023-12-08 06:05:47,000",
6060
"logger_name": "test_json_formatter__outputs_expected",
6161
"process_id": expected_pid,
6262
"thread_name": "MainThread",
@@ -65,7 +65,7 @@ def _log_traceback() -> None:
6565
]
6666

6767

68-
@pytest.mark.freeze_time("2023-12-08T06:05:47.320000+00:00")
68+
@pytest.mark.freeze_time("2023-12-08T06:05:47.000000+00:00")
6969
def test_gunicorn_access_log_json_formatter__outputs_expected() -> None:
7070
# Given
7171
gunicorn_access_log_json_formatter = GunicornAccessLogJsonFormatter()
@@ -92,7 +92,7 @@ def test_gunicorn_access_log_json_formatter__outputs_expected() -> None:
9292
"r": "GET",
9393
"s": 200,
9494
"T": 1,
95-
"t": datetime.fromisoformat("2023-12-08T06:05:47.320000+00:00").strftime(
95+
"t": datetime.fromisoformat("2023-12-08T06:05:47.000+00:00").strftime(
9696
"[%d/%b/%Y:%H:%M:%S %z]"
9797
),
9898
"u": "-",
@@ -120,7 +120,7 @@ def test_gunicorn_access_log_json_formatter__outputs_expected() -> None:
120120
"status": "200",
121121
"thread_name": "MainThread",
122122
"time": "2023-12-08T06:05:47+00:00",
123-
"timestamp": "2023-12-08 06:05:47,319",
123+
"timestamp": "2023-12-08 06:05:47,000",
124124
"user_agent": "requests",
125125
}
126126

0 commit comments

Comments
 (0)