-
Notifications
You must be signed in to change notification settings - Fork 27
/
pyproject.toml
393 lines (320 loc) · 11.4 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
[build-system]
# Defined by PEP 518
requires = ["setuptools>=64", "setuptools_scm>=8"]
# Defined by PEP 517
build-backend = "setuptools.build_meta"
[project]
authors = [{ name = "GeoVista Contributors", email = "[email protected]" }]
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 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Atmospheric Science",
]
description = "Cartographic rendering and mesh analytics powered by PyVista"
dynamic = ["dependencies", "optional-dependencies", "readme", "version"]
keywords = [
"cartography",
"curvilinear",
"earth-science",
"grid",
"mesh",
"python",
"pyvista",
"rectilinear",
"ugrid",
"unstructured",
"vtk",
]
license.file = "LICENSE"
name = "geovista"
requires-python = ">=3.11"
[project.urls]
Code = "https://github.com/bjlittle/geovista"
Discussions = "https://github.com/bjlittle/geovista/discussions"
Documentation = "https://geovista.readthedocs.io"
Issues = "https://github.com/bjlittle/geovista/issues"
[project.scripts]
geovista = "geovista.cli:main"
[tool.check-manifest]
ignore = ["src/geovista/_version.py"]
[tool.codespell]
ignore-words-list = "whet,projets"
skip = ".git,*.css,*.ipynb,*.js,*.html,*.map,*.po,CODE_OF_CONDUCT.md"
[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.
]
exclude = ['\.__eq__$', '\.__ne__$', '\.__repr__$']
[tool.pytest.ini_options]
addopts = [
"--doctest-continue-on-failure",
"--doctest-modules",
"--import-mode=importlib",
"--strict-config",
"--strict-markers",
"-rfEs",
"-v",
]
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS NUMBER"
filterwarnings = [
"error",
"ignore:geovista unable to remesh 1 cell:UserWarning",
"ignore:numpy.ndarray size changed:RuntimeWarning",
"ignore:pyvista test cache image dir:UserWarning",
"ignore:pyvista test generated image dir:UserWarning",
]
image_cache_dir = "tests/plotting/image_cache"
log_cli = "True"
log_cli_level = "INFO"
markers = ["example: gallery image tests", "image: plotting image tests"]
minversion = "6.0"
required_plugins = "pytest-mock pytest_pyvista"
testpaths = "tests"
xfail_strict = "True"
[tool.repo-review]
ignore = [
# https://learn.scientific-python.org/development/guides/style/#MY100
"MY100", # Uses MyPy (pyproject config).
# https://learn.scientific-python.org/development/guides/style/#PC140
"PC140", # Uses mypy.
# https://learn.scientific-python.org/development/guides/style/#PC180
"PC180", # Uses prettier.
]
[tool.ruff]
# Exclude the following, in addition to the standard set of exclusions.
# See https://docs.astral.sh/ruff/settings/#exclude for defaults.
extend-exclude = ["docs/src/generated"]
line-length = 88
src = [".github/scripts", "docs/src", "src", "tests"]
[tool.ruff.format]
docstring-code-format = true
preview = false
[tool.ruff.lint]
# Allow information-source (U+2139) which could be confused for "i".
allowed-confusables = ["ℹ"]
ignore = [
# flake8-commas (COM)
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM812", # Trailing comma missing.
"COM819", # Trailing comma prohibited.
# pydocstyle (D)
# https://docs.astral.sh/ruff/rules/undocumented-magic-method/
"D105", # Missing docstring in magic method.
# flake8-boolean-trap (FBT)
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT002", # Boolean default positional argument in function definition.
# flake8-fixme (FIX)
# https://docs.astral.sh/ruff/rules/line-contains-todo/
"FIX002", # Line contains TODO, consider resolving the issue.
# 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.
# pep8-naming
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N806", # Variable name in function should be lowercase.
"N999", # Invalid module name.
# pandas-vet (PD)
# https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"PD",
# Pylint (PL)
# https://docs.astral.sh/ruff/rules/#pylint-pl
"PLR2004", # Magic value used in comparison, consider replacing with a constant.
# flake8-bandit (S)
# https://docs.astral.sh/ruff/rules/assert/
"S101", # Use of assert detected.
# flake8-todos (TD)
# https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TD003", # Missing issue link on the line following this TODO.
]
preview = false
select = [
"ALL",
# pydocstyle (D)
# https://docs.astral.sh/ruff/rules/multi-line-summary-first-line/
"D212", # Multi-line docstring summary should start at the first line
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["geovista"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.mccabe]
# TODO @bjlittle: refactor to reduce the complexity, if possible
max-complexity = 26
[tool.ruff.lint.pylint]
# TODO @bjlittle: refactor to reduce the complexity, if possible
max-args = 14
max-branches = 29
max-statements = 91
[tool.ruff.lint.per-file-ignores]
".github/scripts/*.py" = [
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT001", # flake8-boolean-trap: Boolean-typed positional argument in function definition.
# https://docs.astral.sh/ruff/rules/implicit-namespace-package/
"INP001", # flake8-no-pep420: File is part of an implicit namespace package.
# https://docs.astral.sh/ruff/rules/print/
"T201", # flake8-print: print found.
]
"conftest.py" = [
# flake8-annotations (ANN)
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN001", # Missing type annotation for function argument.
"ANN201", # Missing return type annotation for public function.
]
"src/geovista/cli.py" = [
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT001", # flake8-boolean-trap: Boolean-typed positional argument in function definition.
# https://docs.astral.sh/ruff/rules/print/
"T201", # flake8-print: print found.
]
"src/geovista/examples/*.py" = [
# https://docs.astral.sh/ruff/rules/typing-only-third-party-import/
"TCH002", # flake8-type-checking: Move 3rd-party import into a type checking block.
]
"src/geovista/examples/earthquakes.py" = [
# https://docs.astral.sh/ruff/rules/line-too-long/
"E501", # pycodestyle: Line too long.
]
"src/geovista/examples/earthquakes_wink1.py" = [
# https://docs.astral.sh/ruff/rules/line-too-long/
"E501", # pycodestyle: Line too long.
]
"src/geovista/examples/spatial_index/uber_h3.py" = [
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT001", # flake8-boolean-trap: Boolean-typed positional argument in function definition.
]
# TODO @bjlittle: resolve use of typing.Any
"src/geovista/geoplotter.py" = [
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN401", # flake8-annotations: Dynamically typed expressions (typing.Any).
]
"test_*.py" = [
# flake8-annotations (ANN)
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN001", # Missing type annotation for function argument.
"ANN201", # Missing return type annotation for public funciton.
# https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SLF001", # flake8-self: Private member accessed.
]
# TODO @bjlittle: investigate behaviour of commented-out failing test
"tests/core/test_slice_lines.py" = [
# https://docs.astral.sh/ruff/rules/#eradicate-era
"ERA001", # eradicate: Found commented-out code.
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.setuptools]
license-files = ["LICENSE"]
zip-safe = false
[tool.setuptools.dynamic]
dependencies = { file = ["requirements/pypi-core.txt"] }
readme = { file = "README.md", content-type = "text/markdown" }
[tool.setuptools.dynamic.optional-dependencies]
cmap = { file = ["requirements/pypi-optional-cmap.txt"] }
docs = { file = ["requirements/pypi-optional-docs.txt"] }
exam = { file = ["requirements/pypi-optional-exam.txt"] }
test = { file = ["requirements/pypi-optional-test.txt"] }
[tool.setuptools.packages.find]
include = ["geovista*"]
where = ["src"]
[tool.setuptools_scm]
local_scheme = "dirty-tag"
version_scheme = "release-branch-semver"
write_to = "src/geovista/_version.py"
[tool.towncrier]
directory = "changelog"
filename = "CHANGELOG.rst"
package = "geovista"
package_dir = "src"
template = "changelog/template.rst"
#
# the order here defines the rendered changelog order
#
[[tool.towncrier.type]]
# Removals and backward incompatible breaking changes.
directory = "breaking"
name = "💣 Breaking Changes"
showcontent = true
[[tool.towncrier.type]]
# Declaration of removals and backward incompatible changes.
directory = "deprecation"
name = "🔥 Deprecations"
showcontent = true
[[tool.towncrier.type]]
# New behaviours, capability, public API etc
directory = "feature"
name = "✨ New Features"
showcontent = true
[[tool.towncrier.type]]
# Updates to existing behaviours, including performance etc
directory = "enhancement"
name = "🚀 Enhancements"
showcontent = true
[[tool.towncrier.type]]
# Correction to undesired behaviours.
directory = "bugfix"
name = "🐛 Bug Fixes"
showcontent = true
[[tool.towncrier.type]]
# Package dependency removals, additions, pins etc
directory = "dependency"
name = "🔗 Dependencies"
showcontent = true
[[tool.towncrier.type]]
# Data, media and asset updates etc
directory = "asset"
name = "💽 Assets"
showcontent = true
[[tool.towncrier.type]]
# Notable changes to the documentation structure, content, render or build
directory = "documentation"
name = "📚 Documentation"
showcontent = true
[[tool.towncrier.type]]
# Miscellaneous internal and maintenance changes.
directory = "internal"
name = "💼 Internal"
showcontent = true
[[tool.towncrier.type]]
# Celebrate our awesome community members, including social changes.
directory = "community"
name = "🌱 Community"
showcontent = true
[[tool.towncrier.type]]
# Changes that affect contributors e.g., standards, conventions,
# running tests, building docs, environments etc
directory = "contributor"
name = "🛠️ Contributor Infrastructure"
showcontent = true
[[tool.towncrier.type]]
# Catch all for items that don't fit elsewhere.
directory = "misc"
name = "🧰 Miscellaneous"
showcontent = true