-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
127 lines (104 loc) · 3.01 KB
/
pyproject.toml
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
[tool.poetry]
name = "hOLper"
version = "0.0.1"
description = "hOLper is a competition management software for the orienteering sport"
license = "GPL-3.0-or-later"
authors = ["Bodo Graumann <[email protected]>"]
readme = "README.rst"
repository = "https://github.com/bodograumann/holper"
packages = [{include = "holper"}]
[tool.poetry.scripts]
holper = "holper.cli:app"
[tool.poetry.dependencies]
python = "^3.10"
PyYAML = "^6.0"
iso8601 = "^1.0.2"
lxml = "^4.9.1"
more-itertools = "^8.13.0"
ortools = "^9.3.10497"
pystache = "^0.6.0"
python-iconv = "^1.1"
sqlalchemy = "^2.0.23"
typer = "^0.9.0"
xdg-base-dirs = "^6.0.1"
pydantic = "^2.5.0"
pydantic-xml = "^2.4.0"
# Optional
psycopg = { version = "^3.0", optional = true }
[tool.poetry.group.dev.dependencies]
black = "^22.8.0"
sphinx = "^5.1.1"
sphinxcontrib-mermaid = "^0.7.1"
ruff = "^0.1.5"
mypy = "^1.7.0"
pytest = "^7.4.3"
pytest-subtests = "^0.11.0"
syrupy = "^4.6.0"
[tool.poetry.extras]
postgres = ["psycopg"]
[tool.ruff]
extend-exclude = [
"docs/conf.py", # Auto-generated
]
select = ["ALL"]
ignore = [
"A00", # This is ok in context of dataclasses, pydantic and sqlalchemy
"ANN101", # Conflicting with mypy in places and due to be removed upstream
"D203", # Conflicts with D211
"D213", # Conflicts with D212
"D", # TODO: Improve doc strings later
"DTZ", # We work in local timezone for now. This should be configurable later.
"PLR2004", # Not useful
"TCH003", # Type annotation are required at run-time for sqlalchemy
"TD", "FIX", # This project is very much a work in progress.
]
line-length = 120
target-version = "py310"
allowed-confusables = [
"’", # This is proper typography. Cf. https://github.com/astral-sh/ruff/issues/1040
]
[tool.ruff.pep8-naming]
classmethod-decorators = [
"sqlalchemy.ext.declarative.declared_attr",
"sqlalchemy.ext.declarative.declared_attr.directive",
]
[tool.ruff.per-file-ignores]
"holper/sportsoftware.py" = [
"PLR0913", # Let’s keep it simple.
]
"holper/cli.py" = [
"UP007", # Union types are not yet supported by typer. Cf. https://github.com/tiangolo/typer/issues/533
]
"holper/iof*" = [
"E501", # Copied docstrings from xml schema
"RUF012", # Pydantic automatically generates a default factory for lists etc.
]
"tests/**/test_*" = [
"ANN", # No need to annotate test functions with types
"D", # No need to put docstrings in tests
"SLF001", # Unit testing private methods is fine
"S101", # We use assert for assertions
]
[tool.black]
line-length = 120
target-version = ["py310", "py311"]
[tool.mypy]
strict = true
exclude = [
"^docs",
]
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = ["docs.*", "tests.*"]
disallow_untyped_defs = false
strict_optional = false
[[tool.mypy.overrides]]
module = ["generate_class_diagram"]
disallow_any_generics = false
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"