Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
125 lines (116 loc) · 3.68 KB
/
Copy pathpyproject.toml
File metadata and controls
125 lines (116 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
[project]
name = "mantis"
version = "2.0.1"
description = "An interactive web application to track Mantis religiosa sightings in Germany."
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"alembic>=1.20.0",
"beautifulsoup4>=4.15.0",
"click>=8.5.0",
"email-validator>=2.3.0",
"flask>=3.1.3",
"flask-favicon>=0.1.4",
"flask-limiter>=4.1.1",
"flask-login>=0.6.3",
"flask-mail>=0.10.0",
"flask-migrate>=4.1.0",
"flask-sqlalchemy>=3.1.1",
"flask-wtf>=1.3.0",
"gunicorn>=26.2.0",
"heroicons[jinja]>=2.14.0",
"jinja2>=3.1.6",
"mako>=1.4.1",
"pillow>=12.3.0",
"pillow-heif>=1.8.0",
"psycopg[binary]>=3.3.6",
"python-dateutil>=2.9.0.post0",
"python-dotenv>=1.2.3",
"pyyaml>=6.0.3",
"requests>=2.34.2",
"shapely>=2.1.2",
"sqlalchemy>=2.0.54",
"svgwrite>=1.4.3",
"werkzeug>=3.1.8",
"wtforms>=3.2.2",
"xlsxwriter>=3.2.9",
]
[dependency-groups]
dev = [
"djlint>=1.46.3",
"openpyxl>=3.1.5",
"pytest>=9.1.1",
"pytest-cov>=7.1.0",
"ruff>=0.16.8",
"sqlalchemy-utils>=0.42.1",
"ty>=0.0.82",
]
docs = [
"sphinx>=9.1.0",
"sphinx-rtd-theme>=3.1.0",
]
[tool.uv]
# Flat layout, no entry points, never published. uv infers this today from the
# absent build-system; saying it keeps a later one from installing the app into
# its own environment.
package = false
[tool.ty.rules]
# Flask-SQLAlchemy builds its own base at runtime (FlaskSQLAlchemyBase, mixing
# in BindMixin and NameMixin), so db.Model is not a class ty can resolve. Every
# model triggers this and no spelling in our code avoids it.
unsupported-base = "ignore"
[tool.pytest.ini_options]
# app/tools holds no tests; it is collected for the doctests in three modules.
testpaths = ["tests", "app/tools"]
pythonpath = ["."]
# No -x: a fault in the shared database fixture errors every test that follows
# it, and the first of those errors says nothing about the cause.
addopts = "-l --doctest-modules"
filterwarnings = [
"error::DeprecationWarning",
# flask-login 0.6.3 (last release, 2023-10-30) calls datetime.utcnow(), which
# 3.12 deprecated. Fixed upstream, unreleased. Drop this on the next release.
"ignore:datetime.datetime.utcnow:DeprecationWarning:flask_login.login_manager",
]
[tool.ruff.lint]
# Pinned: ruff widens its implicit default between releases, so an upgrade would
# add lint errors on its own.
select = ["E4", "E7", "E9", "F"]
extend-select = [
"B", # bugbear
"C4", # comprehensions
"G", # logging format
"I", # isort
"ISC", # implicit str concat
"LOG", # logging misuse
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"RET", # return
"RUF",
"S", # bandit
"SIM", # simplify
"T20", # print
"TRY400", # error() instead of exception() in an except block
"UP", # pyupgrade
]
ignore = [
"RUF001", "RUF002", "RUF003", # ambiguous unicode: fires on German text
"RUF012", # ClassVar on Flask config and SQLAlchemy __table_args__ dicts
"S101", # assert
"S603", # every subprocess call; the shell=True case is S602
]
# Not adopted, too noisy for what they catch here: DTZ, PTH, ARG, PL, TRY.
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S"]
"migrations/**" = ["S608"] # SQL interpolates module constants
"run.py" = ["T201", "S"] # dev launcher
"scripts/**" = ["T201"]
[tool.ruff.lint.flake8-pytest-style]
# Ruff defaults to the tuple form; pytest's own documentation writes "a,b".
parametrize-names-type = "csv"
[tool.djlint]
profile = "jinja"
use_gitignore = true
ignore = "H021,H023"
# H021: layout.html builds a background-image with url_for; a class cannot.
# H023: puts a line break into a title attribute (tooltip).