forked from esm-tools/pycmor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
367 lines (333 loc) · 8.09 KB
/
pyproject.toml
File metadata and controls
367 lines (333 loc) · 8.09 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
[build-system]
requires = [
"setuptools>=61.0",
"wheel",
"versioneer[toml]==0.29",
]
build-backend = "setuptools.build_meta"
[project]
name = "pycmor"
description = "Makes CMOR Simple"
readme = {file = "README.rst", content-type = "text/x-rst"}
license = "MIT"
authors = [
{name = "Paul Gierz", email = "pgierz@awi.de"},
]
maintainers = [
{name = "Paul Gierz", email = "pgierz@awi.de"},
]
requires-python = ">=3.9"
dynamic = ["version"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering :: Oceanography",
]
keywords = ["cmor", "climate", "data", "netcdf", "cmip"]
# NOTE: Please keep this list sorted! In vim, you can use
# visual-block mode (Ctrl-V) to select the lines and then `:sort`.
dependencies = [
"bokeh>=3.4.3",
"cerberus>=1.3.5",
"cf_xarray>=0.9.4",
"cftime>=1.6.4",
"chemicals>=1.2.0",
"click-loguru>=1.3.8",
"dask>=2024.8.0",
"dask_jobqueue>=0.8.5",
"deprecation>=2.1.0",
"distributed>=2024.8.0",
"dpath>=2.2.0",
"everett[yaml]>=3.4.0",
"flexparser>=0.3.1,<0.4", # NOTE(PG): See https://tinyurl.com/ypf99xnh
"flox>=0.9.10",
"h5netcdf>=1.4.1",
"imohash>=1.1.0",
"joblib>=1.4.2",
"netcdf4>=1.7.2",
"numbagg>=0.8.2,<0.9.0", # Pin to avoid TypeAlias import issue in Python 3.9
"numpy>=1.26.4",
"pendulum>=3.0.0",
"pint-xarray>=0.4,<0.6.0",
"prefect[dask]>=3.0.3",
"pyyaml>=6.0.2",
"questionary>=2.0.1",
"randomname>=0.2.1",
"semver>=3.0.4",
"rich-click>=1.8.3",
"streamlit>=1.38.0",
"tqdm>=4.67.0",
"versioneer>=0.29",
"xarray>=2024.7.0",
]
[project.optional-dependencies]
dev = [
"black>=24.8.0",
"dill>=0.3.8",
"flake8>=7.1.1",
"isort>=5.13.2",
"pooch>=1.8.2",
"pre-commit>=4.2.0",
"pyfakefs>=5.6.0",
"pytest>=8.3.2",
"pytest-asyncio>=0.23.8",
"pytest-cov>=5.0.0",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.1",
"sphinx>=7.4.7",
"sphinx_rtd_theme>=2.0.0",
"yamllint>=1.37.1",
]
doc = [
"sphinx-book-theme>=1.1.4",
"sphinx-click>=6.0.0",
"sphinx-copybutton>=0.5.2",
"sphinx-rtd-theme>=2.0.0",
"sphinx-tabs>=3.4.5",
"sphinx-toolbox>=3.7.0",
"sphinx_jinja>=2.0.2",
"sphinxcontrib-napoleon>=0.7",
"watchdog[watchmedo]>=4.0.1",
]
fesom = [
# NOTE(PG): pyfesom2 is now auto-publishing (GH pyfesom2 #215)
# See the relevant information in shell::
#
# $ gh pr view 215 --repo fesom/pyfesom2
"pyfesom2",
]
cmip7 = [
"CMIP7-data-request-api",
]
[project.urls]
Homepage = "https://github.com/esm-tools/pycmor"
Repository = "https://github.com/esm-tools/pycmor"
Documentation = "https://pycmor.readthedocs.io"
"Bug Tracker" = "https://github.com/esm-tools/pycmor/issues"
[project.scripts]
# Canonical entry point
pycmor = "pycmor.cli:main"
# Backward-compatible alias for one transition release
pymor = "pycmor.cli:main"
[project.entry-points."pycmor.cli_subcommands"]
plugins = "pycmor.core.plugins:plugins"
externals = "pycmor.core.externals:externals"
[project.entry-points."pymor.cli_subcommands"]
# Backward-compatible plugin group for existing plugins
plugins = "pycmor.core.plugins:plugins"
externals = "pycmor.core.externals:externals"
[tool.setuptools]
zip-safe = false
include-package-data = true
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests*"]
[tool.setuptools.package-dir]
"" = "src"
[tool.setuptools.package-data]
pycmor = ["data/*.yaml", "data/cmip7/all_var_info.json"]
# Versioneer configuration
[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "src/pycmor/_version.py"
versionfile_build = "pycmor/_version.py"
tag_prefix = "v"
parentdir_prefix = "pycmor-"
# Black configuration
[tool.black]
line-length = 120
target-version = ["py39", "py310", "py311", "py312"]
include = '\.pyi?$'
extend-exclude = '''
(
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| cmip6-cmor-tables
| CMIP7_DReq_Software
| CMIP7-CVs
)/
| _version\.py
| versioneer\.py
)
'''
# isort configuration
[tool.isort]
profile = "black"
line_length = 120
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
extend_skip_glob = [
"cmip6-cmor-tables/*",
"CMIP7_DReq_Software/*",
"CMIP7-CVs/*",
"*/_version.py",
"versioneer.py"
]
# Flake8 configuration
[tool.flake8]
max-line-length = 120
extend-ignore = ["E203", "W503"]
extend-exclude = [
"cmip6-cmor-tables/*",
"CMIP7_DReq_Software/*",
"CMIP7-CVs/*",
"_version.py",
"versioneer.py",
]
per-file-ignores = [
# Allow Black's preferred whitespace in slices
"*/_version.py:E203",
]
# Pytest configuration
[tool.pytest.ini_options]
minversion = "6.0"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=pycmor",
"--cov-report=term-missing",
"-m", "not slow",
]
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"real_data: marks tests to use real downloaded data instead of stubs (requires PYCMOR_USE_REAL_TEST_DATA=1 or marker)",
]
filterwarnings = [
"ignore:Import\\(s\\) unavailable to set up matplotlib support:UserWarning",
]
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ELLIPSIS",
]
# Coverage configuration
[tool.coverage.run]
source = ["src/pycmor"]
branch = true
omit = [
"*/tests/*",
"*/_version.py",
"*/versioneer.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
show_missing = true
precision = 2
[tool.coverage.html]
directory = "htmlcov"
# MyPy configuration (optional, for future use)
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"pycmor.*",
]
ignore_errors = true
# Ruff configuration (optional modern linter alternative)
[tool.ruff]
target-version = "py39"
line-length = 120
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"cmip6-cmor-tables",
"CMIP7_DReq_Software",
"_version.py",
"versioneer.py",
]
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.isort]
known-first-party = ["pycmor"]
[tool.pixi.project]
name = "pycmor"
channels = ["conda-forge"]
platforms = ["osx-arm64", "osx-64", "linux-64"]
[tool.pixi.dependencies]
python = ">=3.10,<3.13"
[tool.pixi.pypi-dependencies]
pycmor = { path = ".", editable = true }
[tool.pixi.tasks]
[tool.pixi.environments]
dev = ["dev"]
[tool.pixi.feature.dev.dependencies]
pytest = "*"
pip = ">=25.2,<26"