-
Notifications
You must be signed in to change notification settings - Fork 17
/
pyproject.toml
317 lines (258 loc) · 9.03 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
[build-system]
# Defined by PEP 518
requires = [
"setuptools>=61",
]
# Defined by PEP 517
build-backend = "setuptools.build_meta"
[project]
authors = [
{name = "ESMF Regrid Contributors", email = "scitools.pub@gmail.com"},
]
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Atmospheric Science",
]
description = "Iris regridding scheme using ESMF"
dynamic = [
"dependencies",
"optional-dependencies",
"readme",
"version",
]
keywords = [
"esmf",
"regrid",
]
license = {text = "BSD-3-Clause"}
name = "esmf_regrid"
requires-python = ">=3.10"
[project.urls]
Code = "https://github.com/SciTools/iris-esmf-regrid"
Docs = "https://iris-esmf-regrid.readthedocs.io/en/stable"
Issues = "https://github.com/SciTools/iris-esmf-regrid/issues"
[tool.codespell]
ignore-words-list = "discontiguities"
[tool.pytest.ini_options]
addopts = ["-ra", "-v", "--doctest-modules", "--strict-config", "--strict-markers"]
minversion = "6.0"
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS NUMBER"
testpaths = "esmf_regrid"
log_cli_level = "INFO"
xfail_strict = true
filterwarnings = ["default"]
[tool.setuptools]
license-files = ["LICENSE"]
zip-safe = false
[tool.setuptools.dynamic]
dependencies = {file = ["requirements/core.txt"]}
readme = {file = "README.md", content-type = "text/markdown"}
version = {attr = "esmf_regrid.__version__"}
[tool.setuptools.dynamic.optional-dependencies]
dev = {file = ["requirements/optional-dev.txt"]}
docs = {file = ["requirements/optional-docs.txt"]}
[tool.setuptools.packages.find]
include = ["esmf_regrid*"]
[tool.repo-review]
ignore = [
# https://learn.scientific-python.org/development/guides/style/#PC170
"PC170", # PyGrep hooks
# https://learn.scientific-python.org/development/guides/style/#PC180
"PC180", # Uses prettier
"PY005", # Test folder location
"GH104", # Unique names for upload artifact
"GH212", # Require GHA update grouping
]
[tool.mypy]
# See https://mypy.readthedocs.io/en/stable/config_file.html
ignore_missing_imports = true
warn_unused_configs = true
warn_unreachable = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
exclude = [
'noxfile\.py',
'docs/src/conf\.py',
'^benchmarks',
]
strict = false # Default value, make true when introducing type hinting.
no_namespace_packages = 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)
"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: determine if these ought to be temporary or permanent
"PR01", # Undocumented parameters
"PR02", # Unknown parameters
"PR04", # Untyped parameters
"PR05", # Improper "."
"PR07", # Undescribed parameter
"PR09", # Missing "."
"PR10", # Missing space before colon
"RT01", # Missing returns section
"RT03", # Undescribed return section
"RT05", # Missing "."
"GL08", # Missing docstring
"SS02", # Missing capitalisation
"SS05", # Third person grammar
]
exclude = [
'\.__eq__$',
'\.__ne__$',
'\.__repr__$',
]
[tool.ruff]
line-length = 88
[tool.ruff.format]
preview = false
[tool.ruff.lint]
ignore = [
# 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: determine if these ought to be temporary or permanent
# Missing type annotations
"ANN001",
"ANN002",
"ANN003",
"ANN101",
"ANN201",
"ANN202",
"ANN204",
"B904", # Try except handling
"C408", # Unnecessary `dict` call
# McCabe complexity https://docs.astral.sh/ruff/rules/complex-structure/
"C901",
"D104", # Misssing docstring
"E501", # Line too long
# Exceptions using string literals
"EM101",
"EM102",
"ERA001", # Commented out code
# imports not used, consider adding to __all__
"F401",
"F403",
"FBT002", # Boolean default positional argument in function definition
"FIX002", # Line contains TODO
"FLY002", # Replace join with f-string
"INP001", # Missing __init__
# Upper case names
"N802",
"N806",
"PERF401", # Use a list comprehension to create a transformed list
# Too many branches, arguments, statements
"PLR0912",
"PLR0913",
"PLR0915",
"PLR2004", # Magic value used in comparison
"PLW2901", # `for` loop target overwritten by assignment target
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple`
"RET504", # Unnecessary assignment before `return`
"S101", # Use of `assert`
"SIM108", # Use ternary operator instead of `if`-`else`-block
"SLF001", # Private member accessed
# Incomplete TODOs
"TD002",
"TD003",
"TID252", # Prefer absolute imports over relative imports from parent modules
"TRY003", # Avoid specifying long messages outside the exception class
]
preview = false
select = [
"ALL",
# list specific rules to include that is skipped using numpy convention.
"D212", # Multi-line docstring summary should start at the first line
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["iris-esmf-regrid"]
[tool.ruff.lint.per-file-ignores]
# All test scripts
# TODO: determine if these ought to be temporary or permanent
"esmf_regrid/tests/*.py" = [
"B006", # Do not use mutable data structures for argument defaults
"N999", # Invalid module name
# Wrong types passed to `@pytest.mark.parametrize`
"PT006",
"PT007",
"PT011", # `pytest.raises(ValueError)` is too broad
# Replace `os` with `Path`
"PTH118",
"PTH123",
"S101", # Use of `assert`
]
"benchmarks/*.py" = [
"ANN205", # Missing type annotations
# Unused arguments
"ARG001",
"ARG002",
"B018", # Found useless expression
"B028", # No explicit `stacklevel` keyword argument found
# Missing docstring
"D102",
"D103",
"DTZ005", # `datetime.datetime.now()` called without a `tz` argument
"PLW1510", # `subprocess.run` without explicit `check` argument
# Replace `os` with `Path`
"PTH107",
"PTH110",
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
"RUF005", # Consider replacing concatenation
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"S101", # Use of `assert`
# Untrusted subprocess call
"S603",
"S607",
"TRY002", # Create your own exception
]
"docs/src/conf.py" = [
"A001", # shadowing python builtin
"E402", # Module level import not at top of file
"DTZ005", # `datetime.datetime.now()` called without a `tz` argument
]
"noxfile.py" = [
"FBT001", # Boolean-typed positional argument in function definition
"PIE810", # Call `startswith`/`endswith` once with a `tuple`
"S310", # Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
"S506", # Consider `yaml.safe_load`
"SIM105", # Use `contextlib.suppress(FileExistsError)` instead of `try`-`except`-`pass`
"T201", # `print` found
]
"setup.py" = [
"EXE001", # Shebang is present but file is not executable
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"