-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
238 lines (219 loc) · 5.96 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
[project]
authors = [
{ name = "Zebedee Nicholls", email = "zebedee.nicholls@climate-resource.com" },
{ name = "Jared Lewis", email = "jared.lewis@climate-resource.com" }
]
requires-python = ">=3.11, <3.12"
# pip dependencies
dependencies = [
"primap2>=0.11.1",
"openscm-units>=0.6.1",
"pydoit-nb>=0.3.4",
"carpet-concentrations>=0.5.1",
"scmdata>=0.17.0",
"openscm-zenodo>=0.3.1",
"python-dotenv>=1.0.1",
]
name = "local"
version = "0.3.0"
description = "Local code to support running the notebooks"
readme = "README.md"
[project.license]
text = "BSD-3-Clause"
[tool.pixi.pypi-dependencies.local]
path = "."
editable = true
# conda dependencies
[tool.pixi.dependencies]
input4mips-validation = "0.15.0"
xarray = "2024.6.0"
doit = ">=0.36.0,<0.37"
jupyterlab = ">=1.0"
loguru-config = ">=0.1.0"
pooch = ">=1.0"
scipy = ">=1.0"
geopandas = ">=1.0"
nc-time-axis = ">=1.4.1,<1.5"
openpyxl = ">=3.1"
# pip optional dependencies
[project.optional-dependencies]
dev = [
"pre-commit",
"mypy",
"pandas-stubs",
"tomli",
"towncrier>=24.8.0",
"types-beautifulsoup4",
"types-tqdm",
"jupyter-resource-usage",
"types-requests>=2.32.0.20241016",
"doit-graph>=0.3.0,<0.4",
]
tests = [
"pytest",
"pytest-regressions[dataframe]",
"coverage",
"pytest-cov",
]
[tool.pixi.environments.tests]
features = [
"tests",
]
solve-group = "default"
[tool.pixi.environments.all-dev]
features = [
"dev",
"tests",
]
solve-group = "default"
[tool.pixi.project]
channels = [
"conda-forge",
]
platforms = [
"osx-64",
"osx-arm64",
"linux-64",
"linux-aarch64",
]
[tool.pixi.feature.dev.dependencies]
pygraphviz = ">=1.14,<2"
pyproj = ">=3.6.1,<4"
[tool.jupytext]
formats = "ipynb,py:percent"
[tool.pytest.ini_options]
addopts = "--strict-markers"
markers = [
"coverage_breaker: marks tests as a coverage breaker (normally because running the test installs things in other venvs which confuses pytest-cov as far as we can tell)",
"nightly: marks tests as being part of the nightly CI",
]
[tool.ruff]
src = ["src"]
target-version = "py311"
# Provide some leeway for long docstring, this is otherwise handled by black
line-length = 110
exclude = ["notebooks-archive/*"]
[tool.ruff.lint]
select = [
"E", # pycodestyle error
"W", # pycodestyle warning
"F", # pyflakes
"I", # isort
"D", # pydocstyle
"PL", # pylint
"TRY", # tryceratops
"NPY", # numpy rules
"RUF", # ruff specifics
"UP", # pyupgrade
"S", # flake8-bandit
# pandas support via pandas-vet. In some cases we will want to disable
# this because it can lead to too many false positives.
"PD",
]
unfixable = [
"PD002", # Disable autofix for inplace as this often introduces bugs
]
ignore = [
"D200", # One-line docstring should fit on one line with quotes
"D400", # First line should end with a period
"PD003", # False positives when using xarray
"PD010", # `.pivot_table` is preferred to `.pivot` or `.unstack`; provides same functionality
"PD013", # False positives when using xarray
]
[tool.ruff.lint.per-file-ignores]
"notebooks/*" = [
"D100", # Missing docstring in public module
"E402", # Module level import not at top of file
"E501", # Line too long (false failure on comments coming from markdown cells)
"S101", # Use of `assert` detected
"PD011", # False positives when using scmdata
]
"stubs/*" = [
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"PLR0913", # Too many arguments
]
"tests/*" = [
"D103", # Missing docstring in public function
"S101", # Use of assert detected
]
[tool.ruff.lint.isort]
known-first-party = ["src"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.mypy]
strict = 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"
[tool.towncrier]
package = "local"
package_dir = "src"
filename = "CHANGELOG.md"
directory = "changelog/"
title_format = "## CMIP GHG Concentration Generation {version} ({project_date})"
underlines = [
"",
"",
"",
]
issue_format = "[#{issue}](https://github.com/climate-resource/CMIP-GHG-Concentration-Generation/pulls/{issue})"
type = [
{ directory = "breaking", name = "⚠️ Breaking Changes", showcontent = true },
{ directory = "deprecation", name = "🗑️ Deprecations", showcontent = true },
{ directory = "feature", name = "🆕 Features", showcontent = true },
{ directory = "improvement", name = "🎉 Improvements", showcontent = true },
{ directory = "fix", name = "🐛 Bug Fixes", showcontent = true },
{ directory = "docs", name = "📚 Improved Documentation", showcontent = true },
{ directory = "trivial", name = "🔧 Trivial/Internal Changes", showcontent = false },
]
[tool.liccheck]
authorized_licenses = [
"bsd",
"bsd license",
"BSD 3-Clause",
"CC0",
"apache",
"apache 2.0",
"apache software",
"apache software license",
"Apache License, Version 2.0",
"Historical Permission Notice and Disclaimer (HPND)",
"isc license",
"isc license (iscl)",
"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",
"zpl 2.1",
]
unauthorized_licenses = [
"agpl",
"gnu agpl",
"gpl v3",
"gplv3",
"gpl v2",
"gplv2",
"gpl v1",
"gplv1",
]
[tool.coverage.report]
fail_under = 80
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",
"@overload",
]