-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathpyproject.toml
More file actions
441 lines (365 loc) · 12.6 KB
/
pyproject.toml
File metadata and controls
441 lines (365 loc) · 12.6 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
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
[build-system]
# Defined by PEP 518
requires = [
"setuptools>=77.0.3",
"setuptools_scm[toml]>=8",
]
# Defined by PEP 517
build-backend = "setuptools.build_meta"
[project]
authors = [
{name = "Iris Contributors", email = "scitools.pub@gmail.com"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"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.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering :: Visualization",
]
dynamic = [
"dependencies",
"readme",
"version",
]
description = "A powerful, format-agnostic, community-driven Python package for analysing and visualising Earth science data"
keywords = [
"cf-metadata",
"data-analysis",
"earth-science",
"grib",
"netcdf",
"meteorology",
"oceanography",
"space-weather",
"ugrid",
"visualisation",
]
license = "BSD-3-Clause"
license-files = ["LICENSE"]
name = "scitools-iris"
requires-python = ">=3.12"
[project.urls]
Code = "https://github.com/SciTools/iris"
Discussions = "https://github.com/SciTools/iris/discussions"
Documentation = "https://scitools-iris.readthedocs.io/en/stable/"
Issues = "https://github.com/SciTools/iris/issues"
[tool.check-manifest]
ignore = [
"lib/iris/_version.py",
"lib/iris/std_names.py",
]
[tool.codespell]
ignore-words-list = "alpha-numeric,assertIn,degreee,discontiguities,lazyness,meaned,nin,re-use,re-uses,re-using,re-used,anc,abl,ND,Nd" # This is the full list of words that we ignore in all repositories.
skip = "./CODE_OF_CONDUCT.md,_build,*.css,*.ipynb,*.js,*.html,*.svg,*.xml,.git,generated"
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.coverage.run]
branch = true
source = [
"lib/iris",
]
omit = [
"lib/iris/tests/*",
"lib/iris/etc/*",
]
[tool.mypy]
# See https://mypy.readthedocs.io/en/stable/config_file.html
# https://mypy.readthedocs.io/en/stable/error_code_list2.html
# TODO: remove when MyPy fixed (see https://github.com/python/mypy/issues/17166)
disable_error_code = ["call-arg"]
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
exclude = [
'noxfile\.py',
'docs/src/conf\.py'
]
ignore_missing_imports = true
strict = false
warn_unreachable = true
warn_unused_configs = true
[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)
# Reason for ignore: A chosen house-style
"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)
# Reason for ignore: A chosen house-style
"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
# Reason for ignore: We benefit from more flexability in formatting
"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.
# TODO: Temporary checks to ignore, will be reviewed at a later date.
"GL08", # The object does not have a docstrings not have a docstring
"PR01", # Parameters ... not documented
"PR02", # Unknown parameters {....}
"PR04", # Parameter "...." has no type
"PR07", # Parameter "...." has no description
"RT01", # No Returns section found
"RT03", # Return value has no description
]
exclude = [
'\.__eq__$',
'\.__ne__$',
'\.__repr__$',
]
[tool.pytest.ini_options]
addopts = [
"-ra",
"--durations=25",
"--strict-config",
"--strict-markers",
]
filterwarnings = ["default"]
log_level = "INFO"
minversion = "6.0"
required_plugins = "pytest-mock"
testpaths = "lib/iris"
xfail_strict = "True"
[tool.repo-review]
# A list of the currently failing repo-review checks.
ignore = [
# PERMANENT IGNORES --------------------------------------------------------
# https://learn.scientific-python.org/development/guides/style/#RF003
"RF003", # So that we can list non-src directories for linting.
# TODO: TEMPORARY IGNORES, for resolving over time -------------------------
# https://learn.scientific-python.org/development/guides/style/#PC170
"PC170", # pre-commit/pygrep-hooks for RST linting.
# https://learn.scientific-python.org/development/guides/style/#PC180
# Not possible to run on the hardware used by the majority of our developers. Might change in future!
"PC180", # Uses prettier.
# https://learn.scientific-python.org/development/guides/packaging-simple#PP006
"PP006", # Uses dev dependency group
# https://learn.scientific-python.org/development/guides/packaging-simple/#PY005
"PY005", # tests/ or src/tests/ directory.
]
[tool.ruff]
# Exclude the following, in addition to the standard set of exclusions.
# https://docs.astral.sh/ruff/settings/#exclude
extend-exclude = [
"_ff_cross_references.py",
"um_cf_map.py",
"docs/src/sphinxext/api_rst_formatting.py",
]
line-length = 88
[tool.ruff.format]
preview = false
[tool.ruff.lint]
ignore = [
# NOTE: To find a rule code to fix, run:
# ruff --select="ALL" --statistics lib/iris/<sub-package>
# 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.
# TODO: exceptions that still need investigating are below. Might be fixable, or might become permanent (above):
# Pyflakes (F)
# https://docs.astral.sh/ruff/rules/#pyflakes-f
"F",
# pycodestyle (E, W)
# https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"E",
# mccabe (C90)
# https://docs.astral.sh/ruff/rules/#mccabe-c90
"C90",
# pep8-naming (N)
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N",
# pydocstyle (D)
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
# (D-1) Permanent
"D105", # Missing docstring in magic method
# (D-2) Temporary, to be removed when we are more compliant. Rare cases mmove to (1).
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
# (D-3) Temporary, before an initial review, either fix ocurrences or move to (2).
"D103", # Missing docstring in public function
# pyupgrade (UP)
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP",
# flake8-annotations (ANN)
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN",
# flake8-bandit (S)
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S",
# flake8-blind-except (BLE)
# https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"BLE",
# flake8-boolean-trap (FBT)
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT",
# flake8-bugbear (B)
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B",
# flake8-builtins (A)
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A",
# flake8-comprehensions (C4)
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C4",
# flake8-datetimez (DTZ)
# https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"DTZ",
# flake8-errmsg (EM)
# https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"EM",
# flake8-future-annotations (FA)
# https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"FA",
# flake8-logging-format (G)
# https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"G",
# flake8-no-pep420 (INP)
# https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"INP",
# flake8-pie (PIE)
# https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PIE",
# flake8-print (T20)
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
"T20",
# flake8-pyi (PYI)
# https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PYI",
# flake8-pytest-style (PT)
# https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"PT019",
# flake8-raise (RSE)
# https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RSE",
# flake8-return (RET)
# https://docs.astral.sh/ruff/rules/#flake8-return-ret
"RET",
# flake8-self (SLF)
# https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SLF",
# flake8-slots (SLOT)
# https://docs.astral.sh/ruff/rules/#flake8-slots-slot
"SLOT",
# flake8-simplify (SIM)
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM",
# flake8-tidy-imports (TID)
# https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"TID",
# flake8-type-checking (TCH)
# https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"TCH",
# flake8-unused-arguments (ARG)
# https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"ARG",
# flake8-use-pathlib (PTH)
# https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PTH",
# flake8-todos (TD)
# https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TD",
# flake8-fixme (FIX)
# https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
"FIX",
# eradicate (ERA)
# https://docs.astral.sh/ruff/rules/#eradicate-era
"ERA",
# pandas-vet (PD)
# https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"PD",
# pygrep-hooks (PGH)
# https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PGH",
# Pylint (PL)
# https://docs.astral.sh/ruff/rules/#pylint-pl
"PL",
# tryceratops (TRY)
# https://docs.astral.sh/ruff/rules/#tryceratops-try
"TRY",
# flynt (FLY)
# https://docs.astral.sh/ruff/rules/#flynt-fly
"FLY",
# Perflint (PERF)
# https://docs.astral.sh/ruff/rules/#perflint-perf
"PERF",
# Ruff-specific rules (RUF)
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF",
]
preview = false
select = [
"ALL",
# Note: the above "all" disables conflicting rules, if you want that
# rule it needs to be explicitly enabled below:
"D212", # Multi-line docstring summary should start at the first line
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["iris"]
known-local-folder = ["_asv_delegated_abc"]
[tool.ruff.lint.mccabe]
max-complexity = 22
[tool.ruff.lint.per-file-ignores]
# https://docs.astral.sh/ruff/rules
# All test scripts
"lib/iris/tests/*.py" = [
# https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D100", # Missing docstring in public module
"D106", # Missing docstring in public nested class
"D205", # 1 blank line required between summary line and description
"D401", # 1 First line of docstring should be in imperative mood
]
"tools/test_*.py" = [
"D100",
"D106",
"D205",
"D401",
]
# Deprecated unittest tests
"lib/iris/tests/__init__.py" = ["PT"]
"lib/iris/tests/unit/tests/test_IrisTest.py" = ["PT"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.setuptools]
zip-safe = false
[tool.setuptools.dynamic]
dependencies = {file = "requirements/pypi-core.txt"}
readme = {file = "README.md", content-type = "text/markdown"}
[tool.setuptools.packages.find]
include = ["iris*"]
where = ["lib"]
[tool.setuptools_scm]
local_scheme = "dirty-tag"
# https://setuptools-scm.readthedocs.io/en/latest/extending/#version-number-construction
version_scheme = "release-branch-semver"
write_to = "lib/iris/_version.py"