-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpyproject.toml
278 lines (250 loc) · 6.98 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
[tool.poetry]
name = "scmdata"
version = "0.17.0"
description = "scmdata provides some useful data handling routines for dealing with data related to simple climate models (SCMs aka reduced complexity climate models, RCMs)"
authors = [
"Jared Lewis <[email protected]>",
"Zeb Nicholls <[email protected]>",
"Mika Pflüger <[email protected]>",
]
readme = "README.md"
packages = [{include = "scmdata", from = "src"}]
keywords = [
"data",
"simple climate model",
"climate",
"scm"
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
[tool.poetry.dependencies]
python = "^3.9"
cftime = ">=1.5"
numpy = "*"
openscm-units = "*"
packaging = "*"
pandas = ">=1.1"
pint = "*"
pint-pandas = "*"
python-dateutil = "*"
tqdm = "*"
six = "*"
xarray = "*"
nc-time-axis = { version = ">=1.2.0", optional = true }
typing-extensions = "*"
matplotlib = { version = "^3.7.1", optional = true }
seaborn = { version = ">=0.12.0", optional = true }
netCDF4 = { version = "*", optional = true }
openpyxl = { version = "*", optional = true }
xlrd = { version = "*", optional = true }
scipy = { version = "*", optional = true }
joblib = { version = "*", optional = true }
notebook = { version = ">=7", optional = true }
pyam-iamc = { version = "*", optional = true }
[tool.poetry.extras]
plots = ["matplotlib", "seaborn" , "nc-time-axis"]
optional = ["netCDF4", "openpyxl", "xlrd", "scipy", "pyam-iamc", "joblib" ]
notebooks = ["notebook"]
[tool.poetry.group.tests.dependencies]
pytest = "^7.3.1"
pytest-benchmark = "*"
[tool.poetry.group.docs.dependencies]
myst-nb = "^0.17.0"
sphinx-rtd-theme = "^1.2.0"
sphinx-autodoc-typehints = "^1.23.0"
sphinx-autodocgen = "^1.3"
jupytext = "^1.14.5"
sphinx-copybutton = "^0.5.2"
[tool.poetry.group.dev.dependencies]
pytest-cov = "^4.0.0"
coverage = "^7.2.0"
black = "23.11.0"
blackdoc = "0.3.8"
mypy = "^1.2.0"
ruff = "0.1.6"
pre-commit = "^3.3.1"
towncrier = "^23.6.0"
liccheck = "^0.9.1"
pandas-stubs = "<3"
[tool.poetry.group.notebooks.dependencies]
myst-nb = "^0.17.0"
sphinx-rtd-theme = "^1.2.0"
sphinx-autodoc-typehints = "^1.23.0"
sphinx-autodocgen = "^1.3"
jupytext = "^1.14.5"
sphinx-copybutton = "^0.5.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.coverage.run]
source = ["src"]
branch = true
[tool.coverage.report]
fail_under = 95
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:",
]
[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"
# Opt outs
# We don't currently have 100% type coverage so the settings below are temporarily added
disallow_untyped_calls = false
disallow_untyped_defs = false
[tool.jupytext]
formats = "ipynb,py:percent"
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"--ignore=tests/test_data"
]
testpaths = "tests"
doctest_optionflags ="NORMALIZE_WHITESPACE"
[tool.ruff]
src = ["src"]
target-version = "py38"
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
]
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
"TRY003", # Avoid specifying long messages outside the exception class
]
# Provide some leeway for long docstring, this is otherwise handled by black
line-length = 110
[tool.ruff.per-file-ignores]
"test*.py" = [
"D", # Documentation not needed in tests
"S101", # S101 Use of `assert` detected
"PLR0913", # Too many arguments to function call
"PLR2004", # Magic value used in comparison
"PLR5501", # Use `elif` instead of `else` then `if`
"NPY002", # Replace legacy `np.random.rand`
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
]
"docs/source/notebooks/*" = [
"D100", # Missing docstring at the top of file
"E402", # Module level import not at top of file
"S101", # Use of `assert` detected
]
"scripts/*" = [
"S101" # S101 Use of `assert` detected
]
"src/scmdata/ops.py" = [
"E501" # Line too long
]
"src/scmdata/processing.py" = [
"PLR2004" # Magic value used in comparison
]
[tool.ruff.pylint]
max-args = 7
[tool.ruff.isort]
known-first-party = ["src"]
[tool.ruff.pydocstyle]
convention = "numpy"
[tool.towncrier]
package = "scmdata"
package_dir = "src"
filename = "docs/source/changelog.md"
directory = "changelog/"
title_format = "## scmdata {version} ({project_date})"
underlines = ["", "", ""]
issue_format = "[#{issue}](https://github.com/openscm/scmdata/pulls/{issue})"
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "improvement"
name = "Improvements"
showcontent = true
[[tool.towncrier.type]]
directory = "fix"
name = "Bug Fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "docs"
name = "Improved Documentation"
showcontent = true
[[tool.towncrier.type]]
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",
]
# 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",
]