Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/api-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
name: API Unit Tests

strategy:
max-parallel: 2
max-parallel: 3
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- name: Cloning repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-run-makefile-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.13
cache: poetry

- name: Install Dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/api-tests-with-private-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
name: API Unit Tests

strategy:
max-parallel: 2
max-parallel: 3
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- name: Cloning repo
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ARG CI_COMMIT_SHA=dev

# Pin runtimes versions
ARG NODE_VERSION=22
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.13

FROM public.ecr.aws/docker/library/node:${NODE_VERSION}-bookworm AS node
FROM cgr.dev/chainguard/wolfi-base:latest AS wolfi-base
Expand Down
568 changes: 167 additions & 401 deletions api/poetry.lock

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ version = "2.68.0"
description = "The API component for the Flagsmith application."
authors = [{ name = "Flagsmith", email = "support@flagsmith.com" }]
readme = "readme.md"
requires-python = ">=3.11, <3.13"
requires-python = ">=3.11, <3.14"
dynamic = ["dependencies"]

[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py311"
target-version = "py313"
extend-exclude = ["migrations"]

[tool.ruff.format]
Expand Down Expand Up @@ -100,8 +100,11 @@ django_settings_module = "app.settings.local"
[tool.drf-stubs]
enabled = true

[tool.poetry]
package-mode = false

[tool.poetry.dependencies]
python = ">3.11,<3.13"
python = ">3.11,<3.14"
django = ">=5,<6"
rudder-sdk-python = "~2.0.2"
segment-analytics-python = "~2.2.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_api_usage_cache(
assert not mocked_track_request_task.called

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

# let's track another request(to trigger flush)
cache.track_request(
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_feature_evaluation_cache(
)

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

# track another evaluation(to trigger cache flush)
cache.track_feature_evaluation(
Expand All @@ -154,7 +154,7 @@ def test_feature_evaluation_cache(
)

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

# track another one(to trigger cache flush)
cache.track_feature_evaluation(
Expand Down
9 changes: 5 additions & 4 deletions api/tests/unit/util/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import logging.config
import os
import sys
from datetime import datetime

import pytest
Expand Down Expand Up @@ -29,7 +30,7 @@ def test_json_formatter__outputs_expected(
expected_tb_string = (
"Traceback (most recent call last):\n"
f' File "{expected_module_path}",'
" line 38, in _log_traceback\n"
" line 39, in _log_traceback\n"
" raise Exception()\nException"
)

Expand All @@ -48,15 +49,15 @@ def _log_traceback() -> None:
{
"levelname": "INFO",
"message": "hello arg1, 22",
"timestamp": "2023-12-08 06:05:47,319",
"timestamp": "2023-12-08 06:05:47,320",
"logger_name": "test_json_formatter__outputs_expected",
"process_id": expected_pid,
"thread_name": "MainThread",
},
{
"levelname": "ERROR",
"message": "this is an error",
"timestamp": "2023-12-08 06:05:47,319",
"timestamp": f"2023-12-08 06:05:47,{320 if sys.version_info >= (3, 13) else 319}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...why not change the timestamp in the freeze_time decorator?

"logger_name": "test_json_formatter__outputs_expected",
"process_id": expected_pid,
"thread_name": "MainThread",
Expand Down Expand Up @@ -120,7 +121,7 @@ def test_gunicorn_access_log_json_formatter__outputs_expected() -> None:
"status": "200",
"thread_name": "MainThread",
"time": "2023-12-08T06:05:47+00:00",
"timestamp": "2023-12-08 06:05:47,319",
"timestamp": f"2023-12-08 06:05:47,{320 if sys.version_info >= (3, 13) else 319}",
"user_agent": "requests",
}

Expand Down
Loading