Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8b18b1a
feat: Add DynamoDB document schemas
khvn26 Dec 11, 2025
815f0d3
add a question
khvn26 Dec 11, 2025
7c45ffb
fix 3.11 support
khvn26 Dec 11, 2025
9d21d93
add all root documents + tests
khvn26 Dec 15, 2025
a29f199
add identity override test
khvn26 Dec 15, 2025
4d8c83a
document environment name default
khvn26 Dec 15, 2025
ac9e8df
rename to flagsmith_schemas.dynamodb
khvn26 Dec 16, 2025
0179e00
Improve docstring
khvn26 Dec 16, 2025
c743785
consolidate scalar types in the types module
khvn26 Dec 16, 2025
d014c4a
Improve feature state docstrings
khvn26 Dec 26, 2025
37a6acd
further docstring improvements
khvn26 Dec 26, 2025
581de51
use Decimal for numeric types
khvn26 Dec 26, 2025
0b438e5
fix ContextValue
khvn26 Dec 26, 2025
c8d92e7
Clarify docstring for multivariate_feature_state_values in FeatureState
khvn26 Jan 2, 2026
aff73eb
Reduce redundancy in name field docstrings
khvn26 Jan 2, 2026
aabc74b
Improve docstring for EnvironmentV2Meta's environment_id to clarify i…
khvn26 Jan 2, 2026
f918972
Enhance docstrings for Identity and EnvironmentV2Meta to clarify thei…
khvn26 Jan 2, 2026
ea2aae8
Clarify docstrings for MultivariateFeatureStateValue fields to enhanc…
khvn26 Jan 2, 2026
e4f100a
Refactor docstring for Environment class to clarify the id field and …
khvn26 Jan 2, 2026
8925857
Add flagsmith_schemas to the module-name in build-backend configuration
khvn26 Jan 2, 2026
a883505
Avoid ImportErrors in pytest when no extras are installed
khvn26 Jan 2, 2026
be97ee2
Avoid ImportErrors in pytest when no extras are installed pt. 2
khvn26 Jan 5, 2026
1c90923
Update docstring for MultivariateFeatureOption.id to clarify field usage
khvn26 Jan 5, 2026
43a7efb
Improve wording
khvn26 Jan 5, 2026
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
*.pyc
.coverage
common.sqlite3
dist/
dist/
coverage.xml
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ optional-dependencies = { test-tools = [
"psycopg2-binary (>=2.9,<3)",
"requests",
"simplejson (>=3,<4)",

], task-processor = [
"backoff (>=2.2.1,<3.0.0)",
"django (>4,<5)",
"django-health-check",
"prometheus-client (>=0.0.16)",
], flagsmith-models = [
"typing_extensions",
] }
authors = [
{ name = "Matthew Elwell" },
Expand Down Expand Up @@ -69,6 +70,7 @@ dev = [
"djangorestframework-stubs (>=3.15.3, <4.0.0)",
"mypy (>=1.15.0, <2.0.0)",
"pre-commit",
"pydantic>=2.12.5",
"pyfakefs (>=5.7.4, <6.0.0)",
"pytest (>=8.3.4, <9.0.0)",
"pytest-asyncio (>=0.25.3, <1.0.0)",
Expand All @@ -78,16 +80,16 @@ dev = [
"pytest-httpserver (>=1.1.3, <2.0.0)",
"pytest-mock (>=3.14.0, <4.0.0)",
"setuptools (>=78.1.1, <79.0.0)",
"types-simplejson (>=3.20.0.20250326, <4.0.0)",
"types-python-dateutil (>=2.9.0.20250516, <3.0.0)",
"types-simplejson (>=3.20.0.20250326, <4.0.0)",
]

[build-system]
requires = ["uv_build>=0.9.17,<0.10.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-name = ["common", "task_processor"]
module-name = ["common", "task_processor", "flagsmith_schemas"]

[tool.coverage.report]
# Regexes for lines to exclude from consideration
Expand Down
22 changes: 12 additions & 10 deletions src/common/test_tools/plugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from functools import partial
from typing import Generator
from typing import TYPE_CHECKING, Generator

import prometheus_client
import pytest
from prometheus_client.metrics import MetricWrapperBase
from pyfakefs.fake_filesystem import FakeFilesystem
from pytest_django.fixtures import SettingsWrapper

from common.test_tools.types import (
AssertMetricFixture,
Expand All @@ -15,6 +11,10 @@
)
from task_processor.task_run_method import TaskRunMethod

if TYPE_CHECKING:
from pyfakefs.fake_filesystem import FakeFilesystem
from pytest_django.fixtures import SettingsWrapper


def pytest_addoption(parser: pytest.Parser) -> None:
group = parser.getgroup("snapshot")
Expand All @@ -26,12 +26,14 @@ def pytest_addoption(parser: pytest.Parser) -> None:


def assert_metric_impl() -> Generator[AssertMetricFixture, None, None]:
import prometheus_client

registry = prometheus_client.REGISTRY
collectors = [*registry._collector_to_names]

# Reset registry state
for collector in collectors:
if isinstance(collector, MetricWrapperBase):
if isinstance(collector, prometheus_client.metrics.MetricWrapperBase):
collector.clear()

def _assert_metric(
Expand All @@ -53,7 +55,7 @@ def _assert_metric(


@pytest.fixture()
def saas_mode(fs: FakeFilesystem) -> Generator[None, None, None]:
def saas_mode(fs: "FakeFilesystem") -> Generator[None, None, None]:
from common.core.utils import is_saas

is_saas.cache_clear()
Expand All @@ -65,7 +67,7 @@ def saas_mode(fs: FakeFilesystem) -> Generator[None, None, None]:


@pytest.fixture()
def enterprise_mode(fs: FakeFilesystem) -> Generator[None, None, None]:
def enterprise_mode(fs: "FakeFilesystem") -> Generator[None, None, None]:
from common.core.utils import is_enterprise

is_enterprise.cache_clear()
Expand All @@ -77,7 +79,7 @@ def enterprise_mode(fs: FakeFilesystem) -> Generator[None, None, None]:


@pytest.fixture()
def task_processor_mode(settings: SettingsWrapper) -> None:
def task_processor_mode(settings: "SettingsWrapper") -> None:
settings.TASK_PROCESSOR_MODE = True
# The setting is supposed to be set before the metrics module is imported,
# so reload it
Expand All @@ -101,7 +103,7 @@ def flagsmith_markers_marked(

@pytest.fixture(name="run_tasks")
def run_tasks_impl(
settings: SettingsWrapper,
settings: "SettingsWrapper",
transactional_db: None,
task_processor_mode: None,
) -> RunTasksFixture:
Expand Down
Empty file.
Loading