-
Notifications
You must be signed in to change notification settings - Fork 57
/
pyproject.toml
231 lines (201 loc) · 6.88 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
################################################################################
# PEP 621 Project Metadata #
################################################################################
# see https://peps.python.org/pep-0621/
[project]
name = "probnum"
description = "Probabilistic Numerics in Python."
readme = "README.md"
requires-python = ">=3.8,<3.12"
license = {file = "LICENSE.txt"}
keywords = [
"probabilistic-numerics",
"machine-learning",
"numerical-methods",
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"numpy>=1.20", "numpy>=1.21.3; python_version>='3.10'", "numpy>=1.24.0; python_version>='3.11'",
"scipy>=1.4", "scipy>=1.8.0; python_version>='3.10'", "scipy>=1.9.2; python_version>='3.11'",
]
dynamic = [
"version",
"optional-dependencies",
]
# TODO (pypa/setuptools#3221): Optional dependencies that reference one another
# don't seem to be supported yet. Migrate the optional dependencies in `setup.py`
# here, once this is supported.
# [project.optional-dependencies]
# ...
# full = [
# "%(jax)s",
# "%(zoo)s",
# "%(pls_calib)s",
# ]
[project.urls]
homepage = "https://probnum.readthedocs.io/en/stable/"
github = "https://github.com/probabilistic-numerics/probnum"
documentation = "https://probnum.readthedocs.io/en/stable/"
benchmarks = "https://probabilistic-numerics.github.io/probnum-benchmarks/benchmarks/"
################################################################################
# PEP 518 Build System Configuration #
################################################################################
# see https://peps.python.org/pep-0518/
[build-system]
requires = [
"setuptools>=61",
"wheel",
"setuptools_scm[toml]>=6.0",
]
build-backend = "setuptools.build_meta"
# see https://setuptools.pypa.io/en/stable/userguide/pyproject_config.html#setuptools-specific-configuration
[tool.setuptools]
platforms = [
"any",
]
zip-safe = false
packages = ["probnum"]
package-dir = { "" = "src" }
include-package-data = true
[tool.setuptools.dynamic]
version = { attr = "probnum._version.version" }
[tool.setuptools_scm]
local_scheme = "dirty-tag"
write_to = "src/probnum/_version.py"
write_to_template = """
# pylint: skip-file
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = \"{version}\"
"""
################################################################################
# Testing Configuration #
################################################################################
# see https://docs.pytest.org/en/stable/reference/customize.html
# see https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref
[tool.pytest.ini_options]
addopts = [
"--verbose",
"--doctest-modules",
]
norecursedirs = [
".*",
"*.egg*",
"dist",
"build",
".tox"
]
testpaths = [
"src",
"tests"
]
doctest_optionflags = "NUMBER NORMALIZE_WHITESPACE"
filterwarnings = [
# "import jax" implies "import flatbuffers", which raises the following warning.
# Ignore similar to https://github.com/google/jax/blob/main/pytest.ini
"ignore:the imp module is deprecated in favour of importlib.*:DeprecationWarning:flatbuffers.*"
]
# see https://coverage.readthedocs.io/en/stable/config.html
[tool.coverage.run]
branch = true
source = [
"probnum",
]
[tool.coverage.paths]
source = [
"src/",
"*/site-packages/",
]
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Don't complain about missing debug-only code:
'def __repr__(self):',
'if self\.debug',
# Don't complain if tests don't hit defensive assertion code:
'raise AssertionError',
'raise NotImplementedError',
# Don't complain if non-runnable code isn't run:
'if 0:',
'if __name__ == .__main__.:',
# Don't complain if operator's are not overloaded
'return NotImplemented'
]
################################################################################
# Linting Configuration #
################################################################################
[tool.pylint.master]
extension-pkg-whitelist = [
"numpy",
]
load-plugins = [
"pylint.extensions.check_elif",
"pylint.extensions.docparams",
"pylint.extensions.docstyle",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.mccabe",
"pylint.extensions.no_self_use",
]
[tool.pylint.messages_control]
disable = [
# We allow TODO comments in the following format: `# TODO (#[ISSUE NUMBER]): This needs to be done.`
"fixme",
# We want to use "mathematical notation" to name some of our variables, e.g. `A` for matrices
"invalid-name",
# Assigning lambda expressions to a variable is sometimes useful, e.g. for defining `LambdaLinearOperator`s
"unnecessary-lambda-assignment",
# Temporary ignore, see https://github.com/probabilistic-numerics/probnum/discussions/470#discussioncomment-1998097 for an explanation
"missing-return-doc",
"missing-yield-doc",
]
[tool.pylint.format]
max-line-length = "88"
[tool.pylint.parameter_documentation]
accept-no-param-doc = false
accept-no-raise-doc = false
accept-no-return-doc = false
accept-no-yields-doc = false
[tool.pylint.design]
max-args = 10
max-complexity = 14
max-locals = 20
[tool.pylint.similarities]
ignore-comments = true
ignore-docstrings = true
ignore-imports = true
ignore-signatures = true
min-similarity-lines = 4
################################################################################
# Formatting Configuration #
################################################################################
# see https://black.readthedocs.io/en/stable/usage_and_configuration/index.html
[tool.black]
include = '\.pyi?$'
# If `exclude` is not set, `black` excludes all files listed in `.gitignore`.
# The following option extends this list of ignored files.
# see https://black.readthedocs.io/en/stable/usage_and_configuration/file_collection_and_discovery.html#gitignore
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories in the root
# of the project.
/(
\.git
| \.hg
)/
'''
# see https://pycqa.github.io/isort/docs/configuration/config_files.html
# see https://pycqa.github.io/isort/docs/configuration/options.html
[tool.isort]
# see https://pycqa.github.io/isort/docs/configuration/profiles.html#black
profile = "black"
combine_as_imports = true
force_sort_within_sections = true