-
Notifications
You must be signed in to change notification settings - Fork 11
/
pyproject.toml
255 lines (230 loc) · 6.85 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
[tool.poetry]
name = "openscm-runner"
keywords = ["openscm", "runner", "python", "simple", "climate", "model"]
version = "0.13.1a0"
description = "Thin wrapper to run emissions scenarios with simple climate models"
authors = [
"Zebedee Nicholls <[email protected]>",
"Robert Gieseke <[email protected]>",
"Jared Lewis <[email protected]>",
"Marit Sandstad <[email protected]>",
"Chris Smith <[email protected]>",
"Sven Willner <[email protected]>",
]
license = "BSD-3-Clause"
readme = "README.md"
repository = "https://github.com/openscm/openscm-runner"
packages = [{include = "openscm_runner", from = "src"}]
include = [
"adapters/fair_adapter/*.csv",
"adapters/ciceroscm_adapter/utils_templates/*.txt",
"adapters/ciceroscm_adapter/utils_templates/pam_RCMIP_test_klimsensdefault.scm",
"adapters/ciceroscm_adapter/utils_templates/run_dir/*.txt",
"adapters/ciceroscm_adapter/utils_templates/run_dir/scm_vCH4fb",
"adapters/ciceroscm_adapter/utils_templates/run_dir/input_OTHER/NATEMIS/*.txt",
"adapters/ciceroscm_adapter/utils_templates/run_dir/input_RF/RFLUC/*.txt",
"adapters/ciceroscm_adapter/utils_templates/run_dir/input_RF/RFSUN/*.txt",
"adapters/ciceroscm_adapter/utils_templates/run_dir/input_RF/RFVOLC/*.txt",
"adapters/ciceroscm_py_adapter/*.txt",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
]
[tool.poetry.dependencies]
python = "^3.9"
openscm-units = ">=0.5.0"
python-dotenv = "^1.0.0"
scmdata = ">=0.7.4"
tqdm = "^4.66.1"
# optional below here
ciceroscm = { version = "1.1.1", optional = true }
fair = { version = "<2", optional = true }
pymagicc = { version = "<3", optional = true }
notebook = { version = "*", optional = true }
seaborn = { version = "^0.13.1", optional = true }
ipywidgets = { version = "^8.1.1", optional = true }
[tool.poetry.extras]
notebooks = ["notebook", "seaborn", "ipywidgets"]
ciceroscmpy = ["ciceroscm"]
fair = ["fair"]
magicc = ["pymagicc"]
models = ["ciceroscm", "fair", "pymagicc"]
[tool.poetry.group.tests.dependencies]
pytest = "^7.3.1"
pytest-regressions = "^2.5.0"
[tool.poetry.group.docs.dependencies]
myst-nb = "^0.17.0"
sphinx-book-theme = "^1.1.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"
mypy = "^1.2.0"
ruff = "^0.1.8"
pre-commit = "^3.3.1"
towncrier = "^23.6.0"
liccheck = "^0.9.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.coverage.run]
source = ["src"]
branch = true
[tool.coverage.report]
fail_under = 65 # TODO: push this back up to 95 over time
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
# 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"
[tool.jupytext]
formats = "ipynb,py:percent"
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
]
[tool.ruff]
src = ["src"]
target-version = "py39"
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
"PD", # Pandas' suggestions: ruff gets confused with scmdata's API
]
line-length = 88
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.per-file-ignores]
"test*.py" = [
"D", # Documentation not needed in tests
"S101", # S101 Use of `assert` detected
"PLR2004" # Magic value used in comparison
]
"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
]
[tool.ruff.isort]
known-first-party = ["src"]
[tool.ruff.pydocstyle]
convention = "numpy"
[tool.towncrier]
package = "openscm_runner"
package_dir = "src"
filename = "docs/source/changelog.md"
directory = "changelog/"
title_format = "## openscm-runner {version} ({project_date})"
underlines = ["", "", ""]
issue_format = "[#{issue}](https://github.com/openscm/openscm-runner/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",
]