-
Notifications
You must be signed in to change notification settings - Fork 43
/
pyproject.toml
462 lines (394 loc) · 12.6 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
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# See https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
# See https://github.com/SciTools/.github/wiki/Linting for common linter rules
[build-system]
# Defined by PEP 518
requires = [
"setuptools>=64",
"setuptools_scm>=8.0",
]
# Defined by PEP 517
build-backend = "setuptools.build_meta"
[project]
authors = [
{name = "Iris-grib Contributors", email = "[email protected]"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering :: Visualization",
]
description = "Functionality for converting between weather/climate datasets stored as GRIB files and SciTools-Iris Cubes"
dynamic = [
"dependencies",
"optional-dependencies",
"readme",
"version",
]
keywords = [
"iris",
"GRIB",
"data-analysis",
"earth-science",
"meteorology",
]
license = {text = "BSD-3-Clause"}
name = "iris-grib"
requires-python = ">=3.10"
[project.urls]
Code = "https://github.com/SciTools/iris-grib"
Discussions = "https://github.com/SciTools/iris-grib/discussions"
Documentation = "https://iris-grib.readthedocs.io/en/stable/"
Issues = "https://github.com/SciTools/iris-grib/issues"
[tool.setuptools]
license-files = ["LICENSE"]
[tool.setuptools.dynamic]
dependencies = {file = "requirements/pypi-core.txt"}
readme = {file = "README.md", content-type = "text/markdown"}
[tool.setuptools.dynamic.optional-dependencies]
dev = {file = "requirements/pypi-optional-dev.txt"}
test = {file = "requirements/pypi-optional-test.txt"}
[tool.setuptools.packages.find]
include = ["iris_grib*"]
where = ["src"]
[tool.setuptools_scm]
write_to = "src/iris_grib/_version.py"
local_scheme = "dirty-tag"
version_scheme = "release-branch-semver"
#------------------------------------------------------------------------------
[tool.coverage.run]
# See https://coverage.readthedocs.io/en/latest/config.html
branch = true
source = [
"src/iris_grib",
]
omit = [
"src/iris_grib/tests/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if __name__ == .__main__.:"
]
[tool.codespell]
# See https://github.com/codespell-project/codespell/tree/master?tab=readme-ov-file#using-a-config-file
ignore-words-list = "alpha-numeric,assertIn,degreee,discontiguities,lazyness,meaned,nin"
skip = "./CODE_OF_CONDUCT.md,_build,*.css,*.ipynb,*.js,*.html,*.svg,*.xml,.git,generated"
[tool.check-manifest]
ignore = [
"src/iris_grib/_version.py",
]
[tool.mypy]
# See https://mypy.readthedocs.io/en/stable/config_file.html
# Extra checks we have chosen to enable.
warn_unused_configs = true
warn_unreachable = true
enable_error_code = ["ignore-without-code", "truthy-bool"]
# Checks we have temporarily *disabled*
# NOTE:
# * Some of these settings are also disabled by "strict = false"
# * See "$ mypy --help" for which
# * Given these settings, "strict = true" generates no errors
# TODO: all of these should eventually be removed
disallow_any_generics = false # 5 errors
disallow_subclassing_any = false # 14 errors
disallow_untyped_calls = false # 8 errors
disallow_untyped_defs = false # 964 errors
disallow_incomplete_defs = false # 3 errors
check_untyped_defs = false # 100 errors
no_implicit_reexport = false # 134 errors
exclude = [
'noxfile\.py',
'docs/conf\.py'
]
strict = true # Default value, make true when introducing type hinting.
[tool.pytest.ini_options]
# See https://docs.pytest.org/en/stable/reference/customize.html
addopts = [
"--doctest-continue-on-failure",
"--doctest-modules",
"-ra",
"--strict-config",
"--strict-markers",
"-v",
]
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS NUMBER"
# configure settings as recommended by repo-review:
log_cli = "True"
log_cli_level = "INFO"
minversion = "6.0"
testpaths = "src/iris_grib"
xfail_strict = "True"
[tool.repo-review]
ignore = [
# https://learn.scientific-python.org/development/guides/style/#MY102
"MY102", # MyPy show_error_codes deprecated
# https://learn.scientific-python.org/development/guides/style/#MY105
"MY105", # MyPy redundant-expr deprecated
# https://learn.scientific-python.org/development/guides/style/#PC170
"PC170", # Uses PyGrep hooks
# https://learn.scientific-python.org/development/guides/style/#PC180
"PC180", # Uses prettier
# https://learn.scientific-python.org/development/guides/pytest/#PP309
"PP309", # Filter warnings specified
]
[tool.ruff]
# Exclude the following, in addition to the standard set of exclusions.
# https://docs.astral.sh/ruff/settings/#exclude
line-length = 88
src = [
"src",
"docs",
]
[tool.ruff.format]
docstring-code-format = true
preview = false
[tool.ruff.lint]
ignore = [
# The following ruff checks are intended to be *permanently* ignored (by design).
# NOTE: *temporary* ignores are listed separately, below.
# flake8-commas (COM)
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM812", # Trailing comma missing.
"COM819", # Trailing comma prohibited.
# flake8-implicit-str-concat (ISC)
# https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
# NOTE: This rule may cause conflicts when used with "ruff format".
"ISC001", # Implicitly concatenate string literals on one line.
# ==============================================
# From here on, we list the *temporary* check disables
# TODO: eventually, remove all these by either
# 1. fixing all code
# 2. adding per-occurence ignores (#qa comments) where needed
# 3. promote the check to the "permanent disables" list above
# flake8-builtins (A)
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A001",
"A002",
# flake8-annotations (ANN)
"ANN001",
"ANN002",
"ANN003",
"ANN101",
"ANN102",
"ANN201",
"ANN202",
"ANN204",
"ANN205",
# flake8-unused-arguments (ARG)
# https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"ARG001",
"ARG002",
"ARG005",
# flake8-bugbear (B)
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B007",
"B018",
"B028",
"B904",
# flake8-blind-except (BLE)
# https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"BLE001",
# flake8-comprehensions (C4)
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C408",
"C901",
# pydocstyle (D)
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"D200", # One-line docstring should fit on one line
"D202", # No blank lines allowed after function docstring
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the second line
"D300", # Use triple double quotes """
"D301", # Use r""" if any backslashes in a docstring
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section
# flake8-datetimez (DTZ)
# https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"DTZ001",
"DTZ006",
# flake8-errmsg (EM)
"EM101",
"EM102",
"EM103",
# eradicate (ERA)
# https://docs.astral.sh/ruff/rules/#eradicate-era
"ERA001",
# flake8-boolean-trap (FBT)
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT001",
"FBT002",
"FBT003",
# flake8-fixme (FIX)
# https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
"FIX002",
"FIX003",
# isort (I)
# https://docs.astral.sh/ruff/rules/#isort-i
"I001", # Import block is un-sorted or un-formatted
# pep8-naming (N)
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N801",
"N802",
"N803",
"N806",
"N999",
# Numpy-specific rules (NPY)
# https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
"NPY002",
# Perflint (PERF)
# https://docs.astral.sh/ruff/rules/#perflint-perf
"PERF203",
"PERF401",
# Refactor (R)
# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR0402",
"PLR0912",
"PLR0913",
"PLR0915",
"PLR1714",
"PLR2004",
"PLR5501",
# Warning (W)
# https://docs.astral.sh/ruff/rules/#warning-w
"PLW0602",
"PLW2901",
# flake8-pytest-style (PT)
"PT009",
"PT027",
# flake8-use-pathlib (PTH)
# https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PTH100",
"PTH107",
"PTH110",
"PTH111",
"PTH112",
"PTH113",
"PTH118",
"PTH120",
"PTH122",
"PTH123",
# flake8-pyi (PYI)
# https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PYI024",
# flake8-return (RET)
# https://docs.astral.sh/ruff/rules/#flake8-return-ret
"RET503",
"RET504",
"RET505",
"RET506",
# flake8-raise (RSE)
# https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RSE102",
# Ruff-specific rules (RUF)
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF005",
"RUF012",
"RUF015",
# flake8-bandit (S)
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S101",
"S110",
"S603",
"S607",
# flake8-simplify (SIM)
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM102",
"SIM108",
"SIM115",
"SIM117",
"SIM118",
# flake8-self (SLF)
# https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SLF001",
# flake8-print (T20)
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
"T201",
# flake8-todos (TD)
# https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TD001",
"TD002",
"TD003",
"TD004",
"TD005",
"TD006",
# tryceratops (TRY)
# https://docs.astral.sh/ruff/rules/#tryceratops-try
"TRY003",
"TRY004",
"TRY301",
# pyupgrade (UP)
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP009",
"UP018",
"UP027",
"UP031",
"UP032",
]
preview = false
select = [
"ALL",
# Note: the above "all" disables conflicting rules, if you want that
# rule it needs to be explicitly enabled below:
"D212", # conflicts with D213 : this one is our choice, so enforce it
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["iris_grib"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.numpydoc_validation]
checks = [
"all", # Enable all numpydoc validation rules, apart from the following:
# -> Docstring text (summary) should start in the line immediately
# after the opening quotes (not in the same line, or leaving a
# blank line in between)
"GL01", # Permit summary line on same line as docstring opening quotes.
# -> Closing quotes should be placed in the line after the last text
# in the docstring (do not close the quotes in the same line as
# the text, or leave a blank line between the last text and the
# quotes)
"GL02", # Permit a blank line before docstring closing quotes.
# -> Double line break found; please use only one blank line to
# separate sections or paragraphs, and do not leave blank lines
# at the end of docstrings
"GL03", # Ignoring.
# -> See Also section not found
"SA01", # Not all docstrings require a "See Also" section.
# -> No extended summary found
"ES01", # Not all docstrings require an "Extended Summary" section.
# -> No examples section found
"EX01", # Not all docstrings require an "Examples" section.
# -> No Yields section found
"YD01", # Not all docstrings require a "Yields" section.
# Record temporarily ignored checks below; will be reviewed at a later date:
# TODO: work to remove these at a later date.
"GL08", # *975 The object does not have a docstring
"PR01", # *149 Parameters ... not documented
"RT01", # *9 No Returns section found
]
exclude = [
'\.__eq__$',
'\.__ne__$',
'\.__repr__$',
]