Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
246 lines (223 loc) · 7.17 KB
/
Copy pathpyproject.toml
File metadata and controls
246 lines (223 loc) · 7.17 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
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
[build-system]
build-backend = 'mesonpy'
requires = [
# >=0.21.0 for limited API (abi3) wheel support, including the handling
# of free-threaded interpreters.
"meson-python>=0.21.0",
"Cython>=3.1.0",
"setuptools_scm[toml]>=6.2",
# numpy requirement for wheel builds for distribution on PyPI - building
# against 2.x yields wheels that are also compatible with numpy 1.x at
# runtime.
"numpy>=2.0.0rc1",
]
[project]
name = 'discretize'
dynamic = ["version"]
description = 'Discretization tools for finite volume and inverse problems'
readme = 'README.rst'
requires-python = '>=3.12'
authors = [{ name = 'SimPEG developers', email = 'rowanc1@gmail.com' }]
keywords = ['finite volume', 'discretization', 'pde', 'ode']
# Note: Python and NumPy upper version bounds should be set correctly in
# release branches, see:
# https://scipy.github.io/devdocs/dev/core-dev/index.html#version-ranges-for-numpy-and-other-dependencies
dependencies = [
# TODO: update to "pin-compatible" once possible, see
# https://github.com/mesonbuild/meson-python/issues/29
"numpy>=1.26.0",
"scipy>=1.12",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Cython",
"Programming Language :: C++",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Natural Language :: English",
]
[project.license]
file = 'LICENSE'
[project.optional-dependencies]
plot = ["matplotlib"]
viz = ["vtk>=9", "pyvista"]
omf = ["omf"]
all = ["discretize[plot,viz,omf]"]
doc = [
"sphinx==9.1",
"pydata-sphinx-theme==0.21.0",
"sphinx-gallery==0.21.0",
"numpydoc==1.10.0",
"jupyter",
"graphviz",
"pillow",
"pooch",
"discretize[all]",
]
test = ["pytest", "pytest-cov", "sympy"]
# when changing these, make sure to keep it consistent with .pre-commit-config.
style = [
"black==26.5.1",
"flake8==7.3.0",
"flake8-bugbear==25.11.29",
"flake8-builtins==3.1.0",
"flake8-mutable==1.2.0",
"flake8-rst-docstrings==0.4.0",
"flake8-docstrings==1.7.0",
"flake8-pyproject==1.2.4",
]
build = [
"meson-python>=0.21.0",
"meson",
"ninja",
"numpy>=2.0.0rc1",
"cython>=3.1.0",
"setuptools_scm",
]
[project.urls]
Homepage = 'https://simpeg.xyz'
Documentation = 'https://discretize.simpeg.xyz'
Repository = 'http://github.com/simpeg/discretize.git'
[tool.setuptools_scm]
[tool.meson-python]
# Build one abi3 wheel per platform (targeting the 3.12 limited API, see
# discretize/_extensions/meson.build) instead of one per Python version.
# Free-threaded builds opt out with `-Dpython.allow_limited_api=false` for
# now: 3.14t has no stable ABI at all, and Cython can't yet generate code
# for the 3.15t one (abi3t). Revisit once Cython ships abi3t support.
limited-api = true
[tool.cibuildwheel]
# cp312-* is the abi3 wheel covering every GIL-enabled CPython >= 3.12. The
# free-threaded builds are ordinary per-version wheels (see the override
# below).
build = ["cp312-*", "cp314t-*", "cp315t-*"]
skip = "*_ppc64le *_i686 *_s390x *-win32"
# skip specialty linux and windows 32bit
build-verbosity = 3
# use the visual studio compilers on windows (a no-op elsewhere)
config-settings = { setup-args = ["--vsenv"] }
# test importing discretize to make sure externals are loadable.
test-command = 'python -c "import discretize; print(discretize.__version__)"'
[[tool.cibuildwheel.overrides]]
# Free-threaded builds use the regular (non-limited) API, see
# [tool.meson-python]. The base setup-args are repeated here because an
# override replaces the whole key rather than appending to it.
select = ["cp314t-*", "cp315t-*"]
config-settings = { setup-args = ["--vsenv", "-Dpython.allow_limited_api=false"] }
[tool.pytest.ini_options]
# avoids discretize/ (a sibling of tests/) shadowing an installed, compiled
# discretize when pytest is invoked from the repo root -- matters most for
# non-editable installs, where the default "prepend" import mode can resolve
# the uncompiled source tree ahead of the real (site-packages) package.
addopts = "--import-mode=importlib"
[tool.coverage.run]
branch = true
# discretize is measured as an importable package (wherever it's installed,
# e.g. site-packages for CI's non-editable install) rather than as the
# discretize/ source directory, which the tests don't actually execute.
source_pkgs = ["discretize"]
source = ["tests", "examples", "tutorials"]
# plugins = [
# "Cython.Coverage",
# ]
[tool.coverage.paths]
# map an installed discretize back onto the repo's discretize/ directory, so
# reports (and codecov) point at the source files.
discretize = ["discretize/", "*/site-packages/discretize/"]
[tool.coverage.report]
ignore_errors = false
show_missing = true
# Regexes for lines to exclude from consideration
exclude_also = [
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
"AbstractMethodError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
[tool.black]
required-version = '26.5.1'
target-version = ['py312', 'py313', 'py314']
[tool.flake8]
extend-ignore = [
# Too many leading '#' for block comment
'E266',
# Line too long (82 > 79 characters)
'E501',
# Do not use variables named 'I', 'O', or 'l'
'E741',
# Line break before binary operator (conflicts with black)
'W503',
# Ignore spaces before a colon (Black handles it)
'E203',
# Ignore spaces around an operator (Black handles it)
'E225',
# Ignore rst warnings for start and end, due to *args and **kwargs being invalid rst, but good for numpydoc
'RST210',
'RST213',
# ignore undocced __init__
'D107',
]
exclude = [
'.git',
'.eggs',
'__pycache__',
'.ipynb_checkpoints',
'docs/examples/*',
'docs/tutorials/*',
'docs/*',
'discretize/_extensions/*.py',
'.ci/*',
]
per-file-ignores = [
# disable unused-imports errors on __init__.py
# Automodule used for __init__ scripts' description
'__init__.py: F401, D204, D205, D400',
# do not check for assigned lambdas in tests
# do not check for missing docstrings in tests
'tests/*: E731, D',
'tutorials/*: D',
'examples/*: D',
]
exclude-from-doctest = [
# Only check discretize for docstring style
'tests',
'tutorials',
'examples',
]
rst-roles = [
'class',
'func',
'mod',
'meth',
'attr',
'ref',
'data',
# Python programming language:
'py:func',
'py:mod',
'py:attr',
'py:meth',
]
rst-directives = [
# These are sorted alphabetically - but that does not matter
'autosummary',
'currentmodule',
'deprecated',
]