api/pyproject.toml
Rama main · réplica de lectura del repositorio original.
# NOTE: you have to use single-quoted strings in TOML for regular expressions.
# It's the equivalent of r-strings in Python. Multiline strings are treated as
# verbose regular expressions by Black. Use [ ] to denote a significant space
# character.
[project]
name = "flagsmith-api"
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.14"
dependencies = [
"django>=5,<6",
"rudder-sdk-python>=2.0.2,<3",
"segment-analytics-python>=2.2.3,<2.3.0",
"backoff>=2.2.1,<2.3.0",
"appdirs>=1.4.4,<1.5.0",
"django-cors-headers>=3.5.0,<3.6.0",
"djangorestframework>=3.18.2,<3.19.0",
"gunicorn>=23.0.0,<23.1.0",
"requests>=2.33.0,<2.34.0",
"six>=1.16.0,<1.17.0",
"whitenoise>=6.0.0,<6.1.0",
"dj-database-url>=3.0.1,<3.1.0",
"drf-nested-routers>=0.92.1,<0.93.0",
"shortuuid>=1.0.1,<1.1.0",
"sendgrid-django>=4.2.0,<4.3.0",
"psycopg2-binary>=2.9.5,<2.10.0",
"coreapi>=2.3.3,<2.4.0",
"django-simple-history>=2.12.0,<2.13.0",
"google-api-python-client>=1.12.5,<1.13.0",
"oauth2client>=4.1.3,<4.2.0",
"djangorestframework-recursive>=0.1.2,<0.2.0",
"chargebee>=3.10.0,<4.0.0",
"python-http-client>=3.3.7,<3.4.0",
"django-health-check>=3.18.2,<3.19.0",
"django-admin-sso>=5.2.0,<5.3.0",
"drf-spectacular>=0.28.0,<0.29.0",
"sentry-sdk>=2.24.1,<3",
"environs>=14.1.1,<15.0.0",
"django-lifecycle>=1.2.4,<1.2.5",
"drf-writable-nested>=0.6.2,<0.7.0",
"django-filter>=2.4.0,<2.5.0",
"flagsmith-flag-engine>=11.1.0,<12.0.0",
"flagsmith-sql-flag-engine>=0.2.0,<0.3.0",
"django-clickhouse-backend>=2,<3",
"clickhouse-driver==0.2.11",
"clickhouse-connect>=1.6.0,<2.0.0",
"boto3>=1.35.95,<1.36.0",
"smart-open[s3]>=7.0.0,<8.0.0",
"slack-sdk>=3.9.0,<3.10.0",
"asgiref>=3.8.1,<3.9.0",
"djangorestframework-api-key>=2.2.0,<2.3.0",
"pymemcache>=4.0.0,<4.1.0",
"google-re2>=1.0,<2.0.0",
"django-softdelete>=0.11.5,<0.12.0",
"simplejson>=3.19.1,<3.20.0",
"djoser>=2.3.0,<3.0.0",
"django-storages>=1.10.1,<1.11.0",
"django-environ>=0.4.5,<0.5.0",
"influxdb-client>=1.50.0,<1.51.0",
"django-ordered-model>=3.4.1,<3.5.0",
"django-ses>=3.5.0,<3.6.0",
"django-axes>=8.1.0,<9.0.0",
"pydantic>=2.12.0,<3.0.0",
"pydantic-collections>=0.6.0,<0.7.0",
"pyngo>=2.4.1,<2.5.0",
"flagsmith>=6.2.0,<7.0.0",
"openfeature-sdk>=0.9.0,<0.10.0",
"openfeature-provider-flagsmith>=1.0.0,<2.0.0",
"python-gnupg>=0.5.1,<0.6.0",
"django-redis>=5.4.0,<6.0.0",
"pygithub>=2.8,<2.9.0",
"hubspot-api-client>=12.0.0,<13.0.0",
"djangorestframework-dataclasses>=1.3.1,<2.0.0",
"pyotp>=2.9.0,<3.0.0",
"flagsmith-common[common-core,flagsmith-schemas,task-processor]>=3.16.1,<4",
"django-stubs>=5.1.3,<6.0.0",
"tzdata>=2024.1,<2025.0.0",
"djangorestframework-simplejwt>=5.5.1,<6.0.0",
"structlog>=24.4.0,<25.0.0",
"prometheus-client>=0.21.1,<0.22.0",
"django-cockroachdb>=4.2,<4.3.0",
"django-oauth-toolkit>=3.0.1,<4.0.0",
"jsonpath-rfc9535>=0.2.0,<0.3.0",
]
[project.optional-dependencies]
private = [
"flagsmith-private>=0.14.2,<1",
]
dev = [
"django-test-migrations>=1.2.0,<2.0.0",
"responses>=0.22.0,<0.23.0",
"pre-commit>=4.0.1,<5.0.0",
"pytest-mock>=3.10.0,<3.11.0",
"pytest-lazy-fixtures>=1.4,<2",
"moto>=4.1.3,<4.2.0",
# TODO: move to https://github.com/adamchainz/time-machine
"pytest-freezegun>=0.4.2,<0.5.0",
# setuptools only exists because pytest-freezegun fails without it
"setuptools",
"pytest-xdist>=3.6.1,<3.7.0",
"pylint>=4.0.9,<4.1.0",
"pep8>=1.7.1,<1.8.0",
"autopep8>=2.0.1,<2.1.0",
"pytest>=9.0.3,<9.1.0",
"pytest-django>=4.8.0,<4.9.0",
"pytest-cov>=4.1.0,<4.2.0",
"datamodel-code-generator>=0.64,<0.65",
"requests-mock>=1.11.0,<2.0.0",
"django-extensions>=3.2.3,<4.0.0",
"pdbpp>=0.12.1,<0.13.0",
"mypy-boto3-dynamodb>=1.33.0,<2.0.0",
"mypy-boto3-s3>=1.36.0,<2.0.0",
"pytest-structlog>=1.1,<2.0.0",
"pyfakefs>=6,<7",
"mypy>=1.15.0,<1.16.0",
"djangorestframework-stubs>=3.15.2,<3.16.0",
"boto3-stubs>=1.36.20,<1.37.0",
"types-requests>=2.32.0.20241016,<3.0.0",
"types-markdown>=3.7.0.20241204,<4.0.0",
"types-pygments>=2.19.0.20250107,<3.0.0",
"types-influxdb-client>=1.45.0.20241221,<2.0.0",
"types-psycopg2>=2.9.21.20250121,<3.0.0",
"types-python-dateutil>=2.9.0.20241206,<3.0.0",
"types-pytz>=2025.1.0.20250204,<2026.0.0",
"ruff>=0.9.7,<0.10.0",
"flagsmith-common[test-tools]",
"pytest-responses>=0.5.1,<0.6.0",
"diff-cover>=10.1.0,<11.0.0",
"django-debug-toolbar",
"ipython>=9.10.0,<10.0.0",
"pyjwt>=2.13.0"
]
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ["."]
# Exclude things that aren't Python packages and avoid sweeping in build dirs
exclude = ["build*", "dist*", "static*", "staticfiles*", "venv*", ".venv*", "scripts*"]
[tool.setuptools.package-data]
"*" = ["*.*"]
[[tool.uv.index]]
name = "flagsmith-pypi-production"
url = "https://flagsmith-production-084060095745.d.codeartifact.eu-west-2.amazonaws.com/pypi/flagsmith-pypi-production/simple/"
explicit = true
[tool.uv.sources]
flagsmith-private = { index = "flagsmith-pypi-production" }
[tool.uv]
required-version = ">=0.13.7" # Ensure this matches the version in .pre-commit-config.yaml
exclude-newer = "1 week"
exclude-newer-package = { flagsmith-private = false, flagsmith-common = false, flagsmith = false, flagsmith-flag-engine = false, flagsmith-sql-flag-engine = false, openfeature-provider-flagsmith = false }
[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py313"
extend-exclude = ["migrations"]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
docstring-code-format = true
# Set the line length limit used when formatting code snippets in
# docstrings.
docstring-code-line-length = "dynamic"
[tool.ruff.lint]
# Establish parity with flake8 + isort
select = ["C901", "E4", "E7", "E9", "F", "I", "W"]
ignore = []
[tool.ruff.lint.per-file-ignores]
# Need the * prefix to work with pre-commit which runs from the root of the repo
"*app/settings/local.py" = ["F403", "F405"]
"*app/settings/production.py" = ["F403", "F405"]
"*app/settings/saas.py" = ["F403", "F405"]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = ['@(abc\\.)?abstractmethod']
[tool.coverage.run]
omit = [
"app/settings/common.py",
"app/settings/local.py",
"manage.py",
"e2etests/*",
"scripts/*",
]
[tool.pytest.ini_options]
pythonpath = ['.']
addopts = [
'--ds=app.settings.test',
'-p',
'no:warnings',
'--dist=worksteal',
'--import-mode=importlib',
]
console_output_style = 'count'
log_level = 'INFO'
markers = [
"clickhouse: test requires a live ClickHouse database (see the clickhouse_db fixture)",
]
[tool.mypy]
plugins = ["mypy_django_plugin.main"]
strict = true
show_absolute_path = true
[[tool.mypy.overrides]]
module = ["admin_sso.default_settings", "admin_sso.models"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["rbac.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["edge_control_plane.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["saml.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["licensing.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["oauth2_provider.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["openfeature_flagsmith.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["clickhouse_backend.*", "clickhouse_driver.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["scim.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["workflows_logic.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Suppresses `no-any-return` when the `scim` package isn't installed (which
# happens on the public PR workflow that runs mypy without the `--extra private`
# extra). With the extra installed, the bearer fixtures return the real `str`.
module = ["tests.integration.scim.conftest"]
warn_return_any = false
[tool.django-stubs]
django_settings_module = "app.settings.local"
[tool.drf-stubs]
enabled = true