forked from resgroup/wind-up
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
145 lines (130 loc) · 3.53 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
[project]
name = "wind-up"
version = "0.1.3"
description = "A tool to assess yield uplift of wind turbines"
authors = [
{ name = "Alex Clerc", email = "alex.clerc@res-group.com" }
]
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
'geographiclib',
'matplotlib',
'pandas >= 2.0.0',
'pyarrow',
'pydantic >= 2.0.0',
'python-dotenv',
'pyyaml',
'requests',
'ruptures',
'scipy',
'seaborn',
'tabulate',
'toml',
'utm',
'tqdm',
]
[project.optional-dependencies]
dev = [
'pytest',
'coverage',
'poethepoet',
'types-pyyaml',
'types-tabulate',
'types-toml',
'types-requests',
'types-tqdm',
'ruff',
'mypy',
]
jupyter = [
'jupyterlab',
'notebook',
'ipywidgets',
]
[tool.setuptools.packages.find]
where = ["."]
include = ["wind_up*"]
[tool.ruff]
line-length = 120
target-version = "py310"
show-fixes = true
extend-exclude = ["tests"]
[tool.ruff.lint]
select = ["ALL"] # https://beta.ruff.rs/docs/rules/
ignore = [
"ANN101", # `self` doesn't need annotations
"ANN102", # `cls` doesn't need annotations
"ANN204", # `__init__` doesn't need annotations
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
"D", # docstring checks
"PGH004", # Use specific rule codes when using `noqa`. Seems to give false alarms
"COM812", # can conflict with ruff formatter
"ISC001", # can conflict with ruff formatter
"G004", # logging statement can use f-string
]
ignore-init-module-imports = true
[tool.ruff.lint.mccabe]
max-complexity = 12 # try to bring this down to 10
[tool.ruff.lint.pylint]
max-branches = 14 # try to bring this down to 12
max-statements = 66 # try to bring this down to 50
max-args = 17 # try to bring this down to 5
[tool.ruff.lint.per-file-ignores]
"wind_up/models.py" = ["N805", "PERF401"] # try to eliminate this
"tests/**/*.py" = ["S101", "PLR2004"] # allow `assert` and magic values in tests
"tests/test_smart_data.py" = ["DTZ001"] # SMART functions use tz naive datetimes
"**/__init__.py" = ["F401"] # ignore unused imports in __init__.py
"examples/**/*.py" = ["T20"] # allow print in examples
[tool.mypy]
plugins = ["pydantic.mypy"]
python_version = "3.10"
exclude = "build|tests|venv|.venv|__ignore__"
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"geographiclib.geodesic",
"pandas",
"pandas.testing",
"ruptures",
"scipy.stats",
"seaborn",
"utm",
]
disable_error_code = ["name-defined"]
ignore_missing_imports = true
[tool.pytest.ini_options]
filterwarnings = [
"error",
"ignore:Passing unrecognized arguments to super:DeprecationWarning", # pycharm debugger issue
"ignore:Passing a BlockManager to DataFrame is deprecated:DeprecationWarning",
]
[tool.coverage.report]
omit = [
"wind_up/plots/*.py",
]
exclude_lines = ["if __name__ == .__main__.:"]
[tool.poe.tasks]
[tool.poe.tasks.lint]
help = "Runs formater and linter"
sequence = [
{ cmd = "ruff format ." },
{ cmd = "ruff check . --fix" },
{ cmd = "mypy ." }
]
[tool.poe.tasks.lint-check]
help = "Checks formatter and linter"
sequence = [
{ cmd = "ruff format . --check" },
{ cmd = "ruff check ." },
{ cmd = "mypy ." }
]
[tool.poe.tasks.test]
help = "Runs unit tests and show coverage"
sequence = [
{ cmd = "coverage run --source wind_up -m pytest ./tests" },
{ cmd = "coverage report -m" },
]
[tool.poe.tasks.all]
help = "Run all required pre-push commands"
sequence = [{ ref = "lint" }, { ref = "test" }]