-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpyproject.toml
More file actions
208 lines (197 loc) · 5.74 KB
/
pyproject.toml
File metadata and controls
208 lines (197 loc) · 5.74 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
[project]
name = "climate-ref-root"
version = "0.12.2"
description = "Climate Rapid Evaluation Framework (REF) root package"
readme = "README.md"
authors = [{ name = "Jared Lewis", email = "jared.lewis@climate-resource.com" }]
requires-python = ">=3.11"
dependencies = [
"climate-ref[postgres]",
"climate-ref-core",
"climate-ref-celery",
"climate-ref-example",
"climate-ref-esmvaltool",
"climate-ref-ilamb",
"climate-ref-pmp",
]
[project.license]
text = "Apache-2.0"
[dependency-groups]
# These are the project wide development dependencies
# These are the dependencies that are required to run the tests, build the docs, etc.
# Each package can have its own dependencies in its own pyproject.toml file in addition to these.
dev = [
"pytest>=9.0.0",
"pytest-celery>=1.1.3",
"pytest-cov>=4.0.0",
"pytest-mock >= 3.12",
"pytest-regressions>=2.5.0",
"coverage>=7.2.0",
"mypy>=1.19.0",
"ruff>=0.14.10",
"pre-commit>=3.3.1",
"towncrier>=25.8.0",
"bump-my-version>=0.28.1",
# License checks
"liccheck>=0.9.2",
"pip>=24.3.1",
# Docs
"mkdocs>=1.6.0",
"mkdocstrings[python]>=0.25.0",
"mkdocs-material>=9.5.0",
"mkdocs-gen-files>=0.5.0",
"mkdocs-section-index>=0.3.9",
"mkdocs-literate-nav>=0.6.1",
"mkdocs-autorefs>=1.0.1",
"mkdocs-jupyter>=0.24.0",
"mkdocs-panzoom-plugin>=0.1.3",
"beautifulsoup4>=4.12,<4.15",
"cartopy>=0.24.1",
"intake-esgf>=2025.7.16",
"ipython>=9.2.0",
"ipywidgets>=8.1.5",
"jupyterlab>=4.2.0",
"jupytext>=1.16.3",
"matplotlib>=3.10.1",
"notebook>=7",
"pandas-indexing>=0.6.3",
"prettyprinter>=0.18.0",
"requests>=2.32.3",
"rich>=14.0.0",
"seaborn>=0.13.2",
"xarray>=2025.4.0",
# Stubs
"pandas-stubs>=2.2.3",
"celery-types>=0.23.0",
"types-tqdm>=4.67",
"pytest-xdist>=3.6.1",
"types-pyyaml>=6.0.12",
"mkdocs-typer>=0.0.3",
]
[tool.uv]
required-version = ">=0.9.0"
[tool.uv.workspace]
members = ["packages/*"]
[tool.uv.sources]
climate-ref = { workspace = true }
climate-ref-core = { workspace = true }
climate-ref-celery = { workspace = true }
climate-ref-example = { workspace = true }
climate-ref-esmvaltool = { workspace = true }
climate-ref-ilamb = { workspace = true }
climate-ref-pmp = { workspace = true }
[tool.coverage.run]
source = ["packages"]
branch = true
[tool.coverage.report]
fail_under = 70
skip_empty = true
show_missing = true
# Regexes for lines to exclude from consideration in addition to the defaults
exclude_also = [
# Don't complain about missing type checking code:
"if TYPE_CHECKING",
# Exclude ... literals
"\\.\\.\\.",
]
omit = [
# Skip alembic migration files
"*/migrations/*",
# Skip the drivers as they can't be checked for coverage
"*/drivers/*",
# Skip the pytest plugin (test infrastructure, not application code)
"*/conftest_plugin.py",
]
[tool.mypy]
strict = true
# prevent unimported libraries silently being treated as Any
disallow_any_unimported = true
# show error codes on failure with context
show_error_codes = true
show_error_context = true
# warn if code can't be reached
warn_unreachable = true
# importing following uses default settings
follow_imports = "normal"
exclude = [
"migrations",
"build",
"dist",
"notebooks",
"scripts",
"stubs",
"tests",
"conftest.py",
"climate_ref_pmp/drivers",
]
mypy_path = "stubs"
# We need a custom mypy plugin to handle the way we create configuration classes
plugins = "mypy_plugin.py"
[tool.jupytext]
formats = "ipynb,py:percent"
[tool.pytest]
addopts = [
"--import-mode=importlib",
"--ignore=packages/climate-ref-pmp/src/climate_ref_pmp/drivers",
]
filterwarnings = [
# PytestAssertRewriteWarning: Module already imported so cannot be rewritten; celery.contrib.pytest
"ignore:Module already imported so cannot be rewritten:pytest.PytestAssertRewriteWarning",
# TestCase, TestDataSpecification, TestCaseRunner, TestCaseNotFoundError, TestCasePaths are domain classes
"ignore:cannot collect test class 'TestCase':pytest.PytestCollectionWarning",
"ignore:cannot collect test class 'TestDataSpecification':pytest.PytestCollectionWarning",
"ignore:cannot collect test class 'TestCaseRunner':pytest.PytestCollectionWarning",
"ignore:cannot collect test class 'TestCaseNotFoundError':pytest.PytestCollectionWarning",
"ignore:cannot collect test class 'TestCasePaths':pytest.PytestCollectionWarning",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"test_cases: marks tests that run diagnostic test cases with ESGF data",
]
strict = true
# We currently check for GPL licensed code, but this restriction may be removed
[tool.liccheck]
authorized_licenses = [
"bsd",
"bsd license",
"BSD 3-Clause",
"BSD-3-Clause",
"BSD-2-Clause",
"CC0",
"apache",
"apache 2.0",
"apache-2.0",
"apache software",
"apache software license",
"Apache License, Version 2.0",
"MIT-CMU",
"CMU License (MIT-CMU)",
"isc license",
"isc license (iscl)",
"GNU Library or Lesser General Public License (LGPL)",
"gnu lgpl",
"lgpl with exceptions or zpl",
"LGPLv2+",
"GNU Lesser General Public License v2 (LGPLv2)",
"GNU Lesser General Public License v2 or later (LGPLv2+)",
"mit",
"mit license",
"Mozilla Public License 2.0 (MPL 2.0)",
"python software foundation",
"python software foundation license",
"PSF-2.0",
"zpl 2.1",
]
# This starting list is relatively conservative. Depending on the project, it
# may make sense to move some of these into the authorized list
unauthorized_licenses = [
"agpl",
"gnu agpl",
"gpl v3",
"gplv3",
"gpl v2",
"gplv2",
"gpl v1",
"gplv1",
]
dependencies = true