blob: aa375d9a32726fd5e9f43dfd9cbaca81f1f2bead [file]
[project]
name = "tooling-directory"
version = "0.1.0"
description = "Apache Directory: LDAP groups, names and member status, the LDAP audit log and the people API"
authors = [
{ name = "ASF Tooling", email = "dev@tooling.apache.org" },
{ name = "ASF Infrastructure", email = "users@infra.apache.org" },
]
requires-python = ">=3.14"
readme = "README.md"
license = "Apache-2.0"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.14",
]
# The skeleton's own needs and no more. Versions follow apache/tooling-agenda's pyproject, so
# that the two tools resolve alike; a feature adds what it uses when it arrives.
dependencies = [
"aiosmtplib~=5.1",
"aiosqlite>=0.22.1,<0.23.0",
"alembic~=1.18",
"asfquart~=0.1.12",
"markdown~=3.10",
"pydantic~=2.13",
"pyyaml~=6.0.2",
"quart-schema[pydantic]~=0.23",
# sqlalchemy is a transitive dependency (via sqlmodel), but its own greenlet requirement is
# limited to a list of platform_machine values (see uv.lock). The asyncio extra's greenlet
# requirement has no such limit, so depend on it directly to keep the async engine working on
# every platform.
"sqlalchemy[asyncio]",
"sqlmodel~=0.0.39",
"uvloop~=0.22",
]
[dependency-groups]
test = [
"pytest>=9.1.1",
"pytest-asyncio>=1.4.0",
"pytest-cov>=7.0.0",
"pytest-xdist>=3.8",
# the behaviour record: the clock it is recorded on, and the import graph that says what a change reaches
"grimp>=3.19",
"time-machine>=3.6.0",
]
dev = [
"djlint>=1.40.3,<2",
"pyright>=1.1.411,<2",
"prek>=0.4.0,<0.5",
"ruff>=0.15.20",
"types-pyyaml>=6.0.12.20260518",
"complexipy>=6.2.0",
]
[tool.uv]
required-version = ">=0.12.2"
package = false
default-groups = [
"test",
"dev",
]
override-dependencies = ["cryptography>=50.0,<51.0.0"]
[build-system]
requires = ["uv_build>=0.9.0,<0.10.0"]
build-backend = "uv_build"
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
[tool.coverage.run]
source = ["app"]
branch = true
omit = [
"app/db/migrations/versions/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
]
[tool.ruff]
line-length = 120
target-version = "py314"
# Alembic writes these, and a change to one is a change of what the database has been through, so a
# linter does not get to rewrite them. The pre-commit hooks already leave them alone; this holds for
# every other way of running ruff as well.
extend-exclude = ["app/db/migrations/versions"]
[tool.ruff.lint]
ignore = [
# A subprocess call here names a deliberate tool and passes an argument list; no shell
# parses any of it, which is the property that matters. S603 cannot see that, and S607
# objects to naming a tool rather than its path - which is what lets the same call work
# in the dev container, in CI and on a committer's machine. A call that ever does take a
# shell needs its own argument.
"S603",
"S607",
]
select = [
"I", # isort
"E",
"W",
"F",
"ASYNC", # flake8-async: what does not belong in a coroutine
"B", # flake8-bugbear: the mistakes that still run
"G", # flake8-logging-format: a log message is a format string, its values are arguments
"LOG", # flake8-logging: how a logger is obtained and called
"N", # pep8-naming
"RUF", # ruff-checks
"S", # flake8-bandit: the security-shaped mistakes
"TID", # flake8-tidy-imports
"TC", # flake8-type-checking
"UP" # pyupgrade
]
[tool.ruff.lint.per-file-ignores]
"app/**/__init__.py" = ["F401", "E402"] # ignore unused and non-top level imports in module initializers for now
"app/*" = ["E731"]
# A test asserts, builds its fixtures out of literals, and reaches for /tmp; flake8-bandit
# reads each of those as the shape of a security mistake. ASYNC240 goes too: reading a
# fixture file with pathlib inside an async test blocks a loop that is serving one test and
# nothing else, where in `app/` the same call is worth an argument. What is deliberately
# *not* ignored is what would still be a finding in a test - a blind
# `pytest.raises(Exception)` (B017) is argued for where it is written.
"tests/**" = ["S101", "S105", "S108", "S701", "ASYNC109", "ASYNC240"]
# One-shot command line tools: they own their event loop and nothing waits on it.
"scripts/**" = ["ASYNC240"]
"e2e/**" = ["ASYNC240"]
"**/{tests}/*" = ["E501", "F841"]
"**/migrations/env.py" = ["F403"]
[tool.djlint]
profile = "jinja"
extension = "html"
indent = 2
blank_line_after_tag = "load,extends,include,html"
close_void_tags = true
format_css = true
format_js = true
max_line_length = 120
use_gitignore = true
preserve_blank_lines = true
ignore = "H006,H021,H031"
include = "app/client/templates"
[tool.pyright]
exclude = [
"**/node_modules",
"**/__pycache__",
"tests",
"**/migrations"
]
ignore = []
defineConstant = { DEBUG = true }
reportMissingImports = "error"
reportMissingTypeStubs = false
venv=".venv"
pythonVersion = "3.14"
executionEnvironments = [
{ root = ".", pythonVersion = "3.14" }
]