Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
78 lines (69 loc) · 2.2 KB
/
Copy pathpyproject.toml
File metadata and controls
78 lines (69 loc) · 2.2 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
[project]
name = "python-template"
version = "0.1.0"
description = "GEG python template package"
authors = [{name="ETHZ/EAPS/GEG Group"}]
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.11"
dependencies = []
[dependency-groups] # e.g. uv add --group dev ruff
dev = [
"mypy~=1.19", # static type checker
"pytest~=9.0", # testing
"ruff~=0.15", # linter and formatter
"pylsp-mypy~=0.7", # provides connection from python LSP to mypy
"pylsp-rope~=0.1", # provides linting tools
"prek>=0.3.13", # git hook management
"cookiecutter~=2.7", # drives template-generation tests
]
[tool.ruff]
target-version = "py311"
line-length = 110
src = ["src"]
# Exclude the cookiecutter template directory — it contains Jinja2 placeholders
# (e.g. {{cookiecutter.project_slug}}) that are not valid Python.
# Using a wildcard avoids glob brace-expansion ambiguity with the {{ }} syntax.
extend-exclude = ["*cookiecutter*", "hooks/post_gen_project.py"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"C90", # mccabe
"D", # pydocstyle
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"D400",
"D415",
"D205",
]
[tool.ruff.lint.per-file-ignores] # otherwise ruff shows "imported but unused" error
"__init__.py" = ["F401"]
"tests/**" = ["D"] # no docstring rules inside tests/ folder
[tool.ruff.lint.pydocstyle] # defines the doc string format
convention = "google"
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
# Enables strict mypy checks; comment this out for projects that do not require strict type checking.
strict = true
# Exclude the cookiecutter template directory (regex substring match).
exclude = ["cookiecutter", "hooks/post_gen_project.py"]
[[tool.mypy.overrides]]
module = "cookiecutter.*"
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]