-
Notifications
You must be signed in to change notification settings - Fork 363
Expand file tree
/
Copy pathpyproject.toml
More file actions
269 lines (241 loc) · 8.33 KB
/
pyproject.toml
File metadata and controls
269 lines (241 loc) · 8.33 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
[project]
name = "fava"
description = "Web interface for the accounting tool Beancount."
readme = "README.rst"
requires-python = ">=3.10"
license = "MIT"
authors = [{ name = "Dominik Aumayr", email = "dominik@aumayr.name" }]
maintainers = [{ name = "Jakob Schnitzer", email = "mail@jakobschnitzer.de" }]
keywords = ["accounting", "beancount", "fava"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Flask",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Information Technology",
"Natural Language :: English",
"Programming Language :: JavaScript",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Office/Business :: Financial :: Accounting",
"Topic :: Office/Business :: Financial :: Investment",
]
dependencies = [
"Babel>=2.11,<3",
"Flask>=2.2,<4",
"Flask-Babel>=3,<5",
"Jinja2>=3,<4",
"Werkzeug>=2.2,<4",
"beancount>=3.2.0,<4",
"beangulp>=0.2",
"beanquery>=0.1,<0.3",
"cheroot>=8,<12",
"click>=7,<9",
"markdown2>=2.3.0,<3",
"ply>=3.4",
"simplejson>=3.16.0,<4",
"typing-extensions>=4.5; python_version<\"3.12\"",
"watchfiles>=0.20.0",
]
dynamic = ["version"]
[project.urls]
Changelog = "https://beancount.github.io/fava/changelog.html"
Chat = "https://gitter.im/beancount/fava"
Homepage = "https://beancount.github.io/fava/"
Issues = "https://github.com/beancount/fava/issues/"
Source = "https://github.com/beancount/fava/"
[project.scripts]
fava = "fava.cli:main"
[project.optional-dependencies]
# Extra dependencies that are needed for the export to excel.
excel = ["pyexcel>=0.5", "pyexcel-ods3>=0.5", "pyexcel-xlsx>=0.5"]
[dependency-groups]
# Stuff for the dev environment.
dev = [
"ruff>=0.11",
{ include-group = "pre-commit" },
{ include-group = "test" },
{ include-group = "types" },
]
# Building the documentation website with sphinx.
docs = ["furo>=2024", "sphinx>=7", "sphinx-autodoc-typehints>=2"]
# Add setuptools for the old_deps constraints
# (otherwise it is not added to the constraints as it's only a build dependency).
old-deps = ["pytest", "setuptools"]
# Running pre-commit hooks.
pre-commit = ["pre-commit>=4"]
# Utilities to deal with github actions.
github-actions = [
"gha-update; python_version>=\"3.12\"",
"zizmor",
]
# Dependencies for tests.
test = [
"fava[excel]",
"pytest>=8",
"pytest-cov>=6",
"setuptools>=67",
"typeguard>=4",
]
# Type-checking with mypy or ty.
types = [
"mypy>=1.14",
"pytest>=8",
"ty>=0.0.2",
"typeguard>=4",
"types-requests>=2.32.0.20250515",
"types-setuptools>=67",
"types-simplejson>=3",
]
[build-system]
requires = ["Babel>=2.7,<3", "setuptools>=80", "setuptools_scm>=8", "wheel"]
build-backend = "_build_backend"
backend-path = ["."]
[tool.uv]
exclude-newer = "7 days"
python-preference = "system"
# Pin some lower bounds for transitive dependencies in the old_deps tests
# This a basically determined by increasing them until getting a combination that runs.
constraint-dependencies = [
"bottle>=0.12.20", # older ones didn't build
"importlib_metadata>=3.6",
"jaraco-functools>=4",
"lxml>=5.3.0", # older ones don't have wheels for recent Python versions
"more-itertools>=6",
"pytest>=7.2", # also used for running the tests of Fava, needs to somewhat recent
"python-dateutil>=2",
"pytz>=2020",
"setuptools>=67",
"six>=1.16",
]
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools_scm]
[tool.babel]
[[tool.babel.mappings]]
method = "python"
pattern = "src/fava/**.py"
[[tool.babel.mappings]]
method = "jinja2"
pattern = "src/fava/**/templates/**.html"
[[tool.babel.mappings]]
method = "javascript"
pattern = "frontend/src/**.ts"
parse_template_string = true
[[tool.babel.mappings]]
method = "fava._babel:extract_svelte"
pattern = "frontend/src/**.svelte"
parse_template_string = true
[tool.black]
line-length = 79
preview = true
[tool.ty.environment]
python-version = "3.12"
[tool.ty.rules]
# There's some mismatches betweeen mypy and ty still
unused-type-ignore-comment = "ignore"
[tool.ty.src]
exclude = ["src/fava/core/ingest.py"]
[tool.mypy]
mypy_path = "stubs"
strict = true
files = ["_build_backend.py", "contrib/scripts.py", "src/fava", "tests"]
[[tool.mypy.overrides]]
module = ["beangulp.*"]
follow_untyped_imports = true
[[tool.mypy.overrides]]
module = ["beanquery.*"]
follow_untyped_imports = true
[[tool.mypy.overrides]]
module = ["flask_babel.*"]
follow_untyped_imports = true
[[tool.mypy.overrides]]
module = ["markdown2.*"]
follow_untyped_imports = true
[tool.pytest.ini_options]
# filterwarnings = "ignore:.*locked_cached_property.*deprecated:DeprecationWarning"
testpaths = ["tests"]
[tool.coverage.run]
branch = true
omit = [
"src/fava/_babel.py",
"src/fava/beans/types.py",
"src/fava/ext/auto_commit.py",
]
[tool.ruff]
line-length = 79
[tool.ruff.lint]
extend-select = ["ALL"]
extend-ignore = [
"ANN401", # allow `typing.Any`
"C901", # ignore mccabe complecity for now
"CPY", # no copyright notices in all files
"COM812", # better handled by formatter - avoid having trailing commas everywhere
"DOC201", # allow returns not to be documented for now
"DOC501", # allow raised exception not to be documented for now
"DOC502", # allow documented exceptions that are not explicitly raised
"D105", # allow magic methods to be undocumented
"D107", # allow __init__ to be undocumented - the class should be.
"PD", # pandas-related, has false-positives
"PERF203", # allow try-except in loop; zero-cost since Python 3.11
"PLR2004", # allow magic constants in comparisons
"PLR6301", # allow methods that do not use self
"S404", # This is a bit over-zelous on subprocess
"S603", # This is a bit over-zelous on subprocess.run
]
[tool.ruff.lint.flake8-type-checking]
strict = true # always move type-only imports to TYPE_CHECKING-if blocks
[tool.ruff.lint.isort]
force-single-line = true
order-by-type = false
known-first-party = ["fava"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 9
[tool.ruff.lint.per-file-ignores]
"contrib/**" = ["D", "INP"]
"docs/**" = ["D", "INP"]
"tests/conftest.py" = ["S101"]
"tests/test_*.py" = ["D", "PLC2701", "S101", "SLF001"]
"tests/data/import_config.py" = ["D", "INP", "S101"]
"tests/data/import_config_with_duplicate_names.py" = ["INP"]
"src/fava/core/filters.py" = ["D"]
# Lazy imports in CLI and request handlers (for conditionally used deps)
"src/fava/{__init__,application,cli}.py" = ["PLC0415"]
# pylint is not run as part of linting for Fava anymore but we keep these disables
# around for devs who might have pylint automatically run by their editors to avoid
# a ton of pylint warnings
# mypy with strict settings handles most of the whole-project analysis where pylint
# still shines - the simpler rules are mostly covered by ruff
[tool.pylint.'messages control']
disable = [
"too-few-public-methods",
"too-many-branches", # is checked by ruff (PLR0912)
"too-many-instance-attributes",
"too-many-locals", # is checked by ruff (PLR0914)
"duplicate-code",
"unused-argument", # is checked by ruff (ARG001)
"stop-iteration-return",
"ungrouped-imports",
"invalid-unary-operand-type", # type-checking like, had false-positives
"not-an-iterable", # type-checking like, had false-positives
"unsubscriptable-object", # type-checking like, had false-positives
"broad-except", # is checked by ruff (BLE)
"too-many-return-statements", # is checked by ruff (PLR0911)
"too-many-arguments", # is checked by ruff (PLR0913)
"too-many-positional-arguments", # is checked by ruff (PLR0917)
"redefined-builtin", # is checked by ruff (A002)
"protected-access", # is checked by ruff (SLF001)
"invalid-name", # is checked by ruff (N)
"missing-docstring", # is checked by ruff (D)
"redefined-outer-name", # false positives for pytest fixtures
]