forked from ESMValGroup/ESMValCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
263 lines (244 loc) · 8.05 KB
/
Copy pathpyproject.toml
File metadata and controls
263 lines (244 loc) · 8.05 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
[build-system]
requires = [
"setuptools >= 40.6.0",
"setuptools_scm>=6.2",
]
build-backend = "setuptools.build_meta"
[project]
authors = [
{name = "ESMValTool Development Team", email = "esmvaltool-dev@listserv.dfn.de"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Hydrology",
"Topic :: Scientific/Engineering :: Physics",
]
dynamic = [
"readme",
"version",
]
dependencies = [
"cartopy",
"cf-units",
"dask[array,distributed]>=2025", # Core/issues/2503
"dask-jobqueue",
"esgf-pyclient>=0.3.1",
"esmf-regrid>=0.11.0",
"esmpy", # not on PyPI
"filelock",
"fiona",
"fire",
"geopy",
"humanfriendly",
"iris-grib>=0.20.0", # github.com/ESMValGroup/ESMValCore/issues/2535
"isodate>=0.7.0",
"jinja2",
"nc-time-axis", # needed by iris.plot
"ncdata",
"nested-lookup",
"netCDF4",
"numpy!=1.24.3",
"packaging",
"pandas",
"pillow",
"prov",
"psutil",
"py-cordex",
"pybtex",
"pyyaml",
"requests",
"rich",
"scipy>=1.6",
"scitools-iris>=3.12.2", # github.com/SciTools/iris/issues/6417
"shapely>=2.0.0",
"stratify>=0.3",
"xarray",
"yamale",
]
description = "A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts"
license = {text = "Apache License, Version 2.0"}
name = "ESMValCore"
requires-python = ">=3.11"
[project.optional-dependencies]
test = [
"pytest>6.0.0",
"pytest-cov>=2.10.1",
"pytest-env",
"pytest-html!=2.1.0",
"pytest-metadata>=1.5.1",
"pytest-mock",
"pytest-xdist",
"ESMValTool_sample_data==0.0.3",
]
doc = [
"autodocsumm>=0.2.2",
"ipython<9.0", # github.com/ESMValGroup/ESMValCore/issues/2680
"nbsphinx>=0.9.7", # github.com/ESMValGroup/ESMValCore/issues/2669
"sphinx>=6.1.3",
"pydata_sphinx_theme",
]
develop = [
"esmvalcore[test,doc]",
"pre-commit",
"pylint",
"pydocstyle",
"vprof",
]
[project.scripts]
esmvaltool = "esmvalcore._main:run"
[project.urls]
Code = "https://github.com/ESMValGroup/ESMValCore"
Community = "https://github.com/ESMValGroup/Community"
Documentation = "https://docs.esmvaltool.org"
Homepage = "https://esmvaltool.org"
Issues = "https://github.com/ESMValGroup/ESMValCore/issues"
[tool.setuptools]
include-package-data = true
license-files = ["LICENSE"]
packages = ["esmvalcore"]
zip-safe = false
[tool.setuptools.dynamic]
readme = {file = "README.md", content-type = "text/markdown"}
[tool.setuptools_scm]
version_scheme = "release-branch-semver"
# Configure tests
[tool.pytest.ini_options]
addopts = [
"-ra",
"--strict-config",
"--strict-markers",
"--doctest-modules",
"--ignore=esmvalcore/cmor/tables/",
"--cov-report=xml:test-reports/coverage.xml",
"--cov-report=html:test-reports/coverage_html",
"--html=test-reports/report.html",
]
log_cli_level = "INFO"
env = {MPLBACKEND = "Agg"}
log_level = "WARNING"
minversion = "6"
markers = [
"installation: Test requires installation of dependencies",
"use_sample_data: Run functional tests using real data",
]
testpaths = ["tests"]
xfail_strict = true
[tool.coverage.run]
parallel = true
source = ["esmvalcore"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
# Configure type checks
[tool.mypy]
# See https://mypy.readthedocs.io/en/stable/config_file.html
ignore_missing_imports = true
enable_error_code = [
"truthy-bool",
]
# Configure linters
[tool.codespell]
skip = "*.ipynb,esmvalcore/config/extra_facets/ipslcm-mappings.yml,tests/sample_data/iris-sample-data/LICENSE"
ignore-words-list = "emac,hist,oce,pres,vas"
[tool.ruff]
line-length = 79
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Ignore until someone has time to fix this:
"ANN", # Adding type hints
"ARG", # Unused argument
"DTZ", # add tzinfo to datetimes
"ERA001", # Found commented-out code
"FBT", # avoid boolean positional arguments
"N818", # Exception name should be named with an Error suffix
"PERF", # Use comprehensions
"PGH003", # Use specific rule codes when ignoring type issues
"PLC0206", # Extracting value from dictionary without calling `.items()`
"PLR2004", # Don't use magic values
"PLW2901", # Don't overwrite a loop variable
"PT009", # Use a regular `assert` instead of unittest-style `assertListEqual`
"PT011", # pytest.raises without match argument
"PT027", # Use `pytest.raises` instead of unittest-style `assertRaises`
"PTH", # Use pathlib everywhere
"RUF022", # `__all__` definitions that are not ordered according to an "isort-style" sort.
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"T201", # `print` statements.
"TD003", # Missing issue link on the line following this TODO
"TRY400", # Uses of `logging.error` instead of `logging.exception` when logging an exception
# Really ignore:
"D105", # Disable missing docstring in magic method as these are well defined.
"E501", # Disable line-too-long as this is taken care of by the formatter.
"FIX002", # TODOs can be useful when something cannot be done immediately.
"PLW1641", # Implementing __hash__ on mutable objects may be more confusing than not doing it.
"S603", # Uncheckable
"TD002", # Missing author in TODO: can be seen from git history
"TRY003", # Fixing this would require many exceptions
]
[tool.ruff.lint.per-file-ignores]
"**.ipynb" = [
"T20", # Printing things in notebooks is fine.
]
"tests/**.py" = [
"S101", # Use of assert in tests code is required.
"T20", # Printing things can help with debugging tests.
"SLF001", # Testing private members is ok
"PLR2004", # Magic values in tests are fine.
# Docstrings in tests are only needed if the code is not self-explanatory.
"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
]
"doc/gensidebar.py" = [
"INP001", # File is part of an implicit namespace package
]
[tool.ruff.lint.isort]
known-first-party = ["esmvalcore"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pylint]
max-args = 7
# Configure linters that are run by Prospector
# TODO: remove once we have enabled all ruff rules for the tools provided by
# Prospector, see https://github.com/ESMValGroup/ESMValCore/issues/2528.
[tool.pylint.main]
jobs = 1 # Running more than one job in parallel crashes prospector.
ignore-paths = [
"doc/conf.py", # Sphinx configuration file
]
[tool.pylint.basic]
good-names = [
"_", # Used by convention for unused variables
"i", "j", "k", # Used by convention for indices
"logger", # Our preferred name for the logger
]
[tool.pylint.format]
max-line-length = 79
[tool.pylint."messages control"]
disable = [
"import-error", # Needed because Codacy does not install dependencies
"file-ignored", # Disable messages about disabling checks
"line-too-long", # Disable line-too-long as this is taken care of by the formatter.
"locally-disabled", # Disable messages about disabling checks
]
[tool.pydocstyle]
convention = "numpy"