-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
239 lines (224 loc) · 7.89 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
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
[tool.poetry]
name = "pyflexplot"
# Keep only Major and Minor version in this configuration,
# the patch version is calculated when releasing the library
version = "2.2.0"
description = "PyFlexPlot - Visualize and post-process FLEXPART dispersion simulation results stored in NetCDF format"
packages = [
{ include = "pyflexplot", from = "src" },
{ include = "srtools", from = "src" },
{ include = "srutils", from = "src" },
{ include = "words", from = "src" }
]
readme = "README.md"
repository = "https://github.com/MeteoSwiss-APN/pyflexplot"
documentation = "https://github.io/MeteoSwiss-APN/pyflexplot"
keywords = [
"Dispersion",
"Flexpart",
"COSMO",
"mapping",
"visualization",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
]
[tool.poetry.scripts]
pyflexplot = "pyflexplot.cli.cli:cli"
crop-netcdf = "srtools.crop_netcdf:main"
[[tool.poetry.source]]
name = "pypi-meteoswiss"
url = "https://service.meteoswiss.ch/nexus/repository/python-all/simple"
priority = "primary"
[[tool.poetry.source]]
name = "pypi-mch-publish"
url = "https://service.meteoswiss.ch/nexus/repository/python-mch/"
[tool.poetry.dependencies]
python = "~3.10" # python version restricted by pillow
boto3 = "^1.34.108"
botocore = "^1.34.109"
cartopy = "^0.22"
click = "^8.0"
geopy = "^2.4.0"
matplotlib = "^3.8.1"
netcdf4 = "^1.6.5"
numpy = "^1.21.6"
pillow = "^8.4.0"
pydantic = "~2.6.2"
pydantic-settings = "^2.2.1"
pypdf = "^3.10.0"
pyyaml = "^6.0.1"
scipy = "^1.11.3"
toml = "^0.10.2"
typing-extensions = "^4.8.0"
[tool.poetry.group.dev.dependencies]
black = "^24.3.0"
boto3-stubs = "^1.34.113"
botocore-stubs = "^1.34.94"
codespell = " ^2.2.6"
flake8 = "^7.0.0"
moto = {extras = ["s3"], version = "^5.0.7"}
mypy = "^1.6.1"
pydata-sphinx-theme = "^0.14.1"
pydocstyle = "^6.3.0"
pytest = "^7.4.3"
pytest-cov = "^4.1.0"
pylint = "^3.0.2"
Sphinx = "^7.2.6"
sphinx-autoapi = "^3.0.0"
types-setuptools = "^68.2.0.0"
types-pyyaml = "^6.0.12.20240311"
[tool.pytest.ini_options]
pythonpath = "src"
testpaths = ["tests"]
addopts = [
"-s",
"-ra",
"--pdbcls=IPython.terminal.debugger:TerminalPdb",
"--tb=short",
# "--cov=pyflexplot",
# "--mypy",
]
[tool.black]
[tool.isort]
default_section = "THIRDPARTY"
profile = "black"
force_single_line = true
order_by_type = false
# Set `multi_line_output = 7` to mark too long lines with `# NOQA` (uppercase!)
# instead of spreading them over multiple lines. This leaves lines with long
# trailing comments intact, which may occur if multiple directives are necessary
# (e.g., `# type: ignore [import] # pylint: disable=no-name-in-module`).
# (Note that thanks to `force_single_line = true`, this should be the main
# reason for too long lines because multi-import lines are already broken up.)
multi_line_output = 7 # 7=noqa
# Headings
import_heading_stdlib = "Standard library"
import_heading_thirdparty = "Third-party"
import_heading_firstparty = "First-party"
import_heading_localfolder = "Local"
# Known modules to avoid misclassification
known_standard_library = [
# Add standard library modules that may be misclassified by isort
]
known_third_party = [
# Add third-party modules that may be misclassified by isort
]
known_first_party = [
# Add first-party modules that may be misclassified by isort
"pyflexplot",
"srtools",
"srutils",
"words",
]
[tool.mypy]
files=["src/**/*.py"]
[[tool.mypy.overrides]]
# Note: Only globally ignore missing imports as a matter of last resort!
# See https://blog.wolt.com/engineering/2021/09/30/professional-grade-mypy-configuration/
module = [
# Add external modules w/o type hints here
# Todo: replace by "type: ignore [import]" directives in code
"cartopy.*",
"click.*",
"geopy.*",
"IPython.*",
"matplotlib.*",
"netCDF4.*",
"PyPDF2.*",
"scipy.*",
"shapely.*",
"tomlkit.*",
"toml.*"
]
ignore_missing_imports = true
[tool.flake8]
max-line-length = 88
# max-complexity = 10
ignore = [
"E203", # Allow whitespace before ':' (https://github.com/PyCQA/pycodestyle/issues/373)
"F811", # Allow redefinition of unused name (necessary for typing.overload)
"I002", # Don't check for isort configuration
"W503", # Allow line break before binary operator (PEP 8-compatible)
]
per-file-ignores = [
"__init__.py: F401", # Allow unused imports
]
[tool.pylint]
recursive = true
ignore-imports = true
max-line-length = 88
# Tweak valid name formats
# Defaults (http://pylint-messages.wikidot.com/messages:c0103):
# argument-rgx = "^[a-z_][a-z0-9_]{2,30}$"
# attr-rgx = "^[a-z_][a-z0-9_]{2,30}$"
# function-rgx = "^[a-z_][a-z0-9_]{2,30}$"
# method-rgx = "^[a-z_][a-z0-9_]{2,30}$"
# variable-rgx = "^[a-z_][a-z0-9_]{2,30}$"
# class-rgx = "^[A-Z_][a-zA-Z0-9]+$"
# const-rgx = "^(([A-Z_][A-Z0-9_]*)|(__.*__))$"
# module-rgx = "^(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$"
argument-rgx = "^[a-z_][a-z0-9_]{,40}$"
attr-rgx = "^[a-z_][a-z0-9_]{,40}$"
function-rgx = "^[a-z_][a-z0-9_]{,40}$"
method-rgx = "^[a-z_][a-z0-9_]{,40}$"
variable-rgx = "^[a-z_][a-z0-9_]{,40}$"
class-rgx = "^[A-Z_][a-zA-Z0-9]+$"
const-rgx = "^(([a-z_][a-z0-9_]*)|([A-Z_][A-Z0-9_]*)|(__[a-zA-Z0-9]+__))$"
module-rgx = "^(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$"
inlinevar-rgx = "^[A-Za-z_][A-Za-z0-9_]*$"
# Disable selected warnings, errors etc. that conflict with style guide etc.
# Note: To locally ignore certain errors, use "pylint: disable=XXXX" comments instead!
disable = [
"C0115", # Missing class docstring
"C0116", # Missing function or method docstring
"R0903", # Too few public methods (*/2) (too-few-public-methods)
# "R0801", # Similar lines in 2 files (duplicate-code)
# -> see https://github.com/PyCQA/pylint/issues/214
"R1705", # Unnecessary "elif" after "return" (no-else-return)
"R1720", # Unnecessary "elif" after "raise" (no-else-raise)
"R1724", # Unnecessary "elif" after "continue" (no-else-continue)
"W1116", # Second argument of isinstance is not a type (isinstance-second-argument-not-valid-type)
# Migrated from old blueprint, check if still needed
"W0602", # Using global for '...' but no assignment is done (global-variable-not-assigned)
"E0401", # Unable to import '...' (import-error)
# -> Wrongly triggered for relative imports (pylint v2.11.1, 2022-03-09)
# -> TODO Re-enable once fixed (see https://github.com/PyCQA/pylint/issues/3651)
"R0801", # Similar lines in 2 files (duplicate-code)
]
# Ignore (sub-)modules that trigger errors like E1101 (no-member) or E0611 (no-name-in-module)
#ignored-modules = [
# # Migrated from old blueprint, todo: replace by pylint disable directives in code
# "cartopy", # E1101 (no-member) (PlateCarree)
# "netCDF4", # E1101 (no-member)
#]
[tool.pydocstyle]
# All codes: http://www.pydocstyle.org/en/stable/error_codes.html
ignore = [
# "D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
# "D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
# "D105", # Missing docstring in public nested class
# "D107", # Missing docstring in __init__
"D203", # Blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D405", # Section name should be properly capitalized
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section
]
[tool.rstcheck]
ignore_directives = [
"automodule",
"mdinclude",
]
[tool.codespell]
ignore-words-list = "ende,ue,fo,activ,nd,feld,nd"
skip = "requirements/*,*.pdf,environment.yml"