From e9f494ed9d409af00a9e313460aa4f47c0e72712 Mon Sep 17 00:00:00 2001 From: Frank Schwenk Date: Sat, 18 Jul 2026 17:10:31 +0200 Subject: [PATCH] chore: add pyproject.toml with ruff and pytest config Pin Python 3.11 for parity with the Docker image. Dev deps live in requirements-dev.txt for local lint/test without rembg/onnxruntime. Co-authored-by: Cursor --- .python-version | 1 + pyproject.toml | 41 +++++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 4 ++++ 3 files changed, 46 insertions(+) create mode 100644 .python-version create mode 100644 pyproject.toml create mode 100644 requirements-dev.txt diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..2c07333 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..61cc886 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[project] +name = "livef12rocks" +version = "0.1.0" +description = "Event photo pep pipeline: Syncthing drop -> gmic/rembg -> web" +readme = "README.md" +requires-python = ">=3.11,<3.12" + +[project.optional-dependencies] +dev = [ + "pytest>=8.3,<9", + "httpx>=0.27,<0.29", + "ruff>=0.8,<0.10", +] + +[tool.pytest.ini_options] +testpaths = ["tests"] +pythonpath = ["."] + +[tool.ruff] +target-version = "py311" +line-length = 120 +src = ["app", "tests"] + +[tool.ruff.lint] +select = [ + "E", # pycodestyle errors + "F", # pyflakes + "I", # isort + "UP", # pyupgrade + "B", # flake8-bugbear + "SIM", # flake8-simplify +] +ignore = [ + "B008", # FastAPI Depends/Form in defaults is intentional +] + +[tool.ruff.lint.per-file-ignores] +"tests/**" = ["S101"] # assert in tests + +[tool.ruff.format] +quote-style = "double" diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..39aa9d7 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,4 @@ +-r requirements.txt +pytest>=8.3,<9 +httpx>=0.27,<0.29 +ruff>=0.8,<0.10