forked from PlasmaPy/PlasmaPy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
454 lines (421 loc) · 13.3 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >= 61.2.0",
"setuptools-scm >= 6.3.2",
"wheel >= 0.37.0",
]
[project]
name = "plasmapy"
description = "Python package for plasma science"
readme = "README.md"
keywords = [
"astronomy",
"fusion",
"heliophysics",
"plasma",
"plasma physics",
"science",
"solar physics",
"space plasmas",
]
license = {file = "LICENSE.md"}
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Astronomy",
]
dynamic = [
"version",
]
dependencies = [
"astropy >= 5.1",
"h5py >= 3.7.0",
"ipykernel >= 6.8.0",
"ipywidgets >= 7.7.0",
"lmfit >= 1.1.0",
"matplotlib >= 3.5.1",
"mpmath >= 1.2.1",
"numba >= 0.57.0",
"numpy >= 1.23.0",
"packaging >= 22.0",
"pandas >= 1.4.0",
"pytest == 7.4.4",
"requests >= 2.28.0",
"scipy >= 1.8.0",
"setuptools >= 61.2.0",
"tqdm >= 4.60.0",
"voila >= 0.5.0",
"wrapt >= 1.14.0",
"xarray >= 2022.3.0",
]
[project.optional-dependencies]
docs = [
"docutils >= 0.20.1",
"jinja2 >= 3.1.3",
"nbsphinx >= 0.9.3",
"numpydoc >= 1.6.0",
"pillow >= 10.2.0",
"pygments >= 2.17.2",
# install setuptools to get pkg_resources for doc build
"setuptools; python_version >= '3.12'",
# see issue 2497
"sphinx == 7.2.6",
"sphinx-changelog >= 1.5.0",
"sphinx-codeautolink >= 0.15.0",
"sphinx-copybutton >= 0.5.2",
"sphinx-gallery >= 0.15.0",
"sphinx-hoverxref >= 1.3.0",
"sphinx-issues >= 4.0.0",
"sphinx-notfound-page >= 1.0.0",
"sphinx-reredirects >= 0.1.3",
"sphinx_rtd_theme >= 2.0.0",
"sphinx_tabs >= 3.4.5",
"sphinx_collapse >= 0.1.2",
"sphinxcontrib-bibtex >= 2.6.2",
"sphinxcontrib-globalsubs >= 0.1.1",
"towncrier >= 23.11.0",
"tox >= 4.12.1",
"unidecode >= 1.3.8",
]
tests = [
"hypothesis >= 6.97.4",
"pre-commit >= 3.6.0",
"pytest-regressions >= 2.5.0",
"pytest-xdist >= 3.5.0",
"tomli >= 2.0.1",
"tox >= 4.12.1",
]
[project.urls]
Changelog = "https://docs.plasmapy.org/en/stable/whatsnew/index.html"
Chat = "https://plasmapy.org/chat"
Documentation = "https://docs.plasmapy.org/"
Issues = "https://github.com/PlasmaPy/plasmapy/issues/"
Source = "https://github.com/PlasmaPy/plasmapy"
Twitter = "https://twitter.com/PlasmaPy"
website = "https://www.plasmapy.org"
[project.scripts]
plasma-calculator = "plasmapy.utils.calculator:main"
[tool.setuptools]
include-package-data = true
[tool.setuptools.package-data]
"plasmapy.particles.data" = ["*"]
"plasmapy.tests" = ["coveragerc"]
"plasmapy.utils.calculator" = ["*"]
[tool.setuptools.packages.find]
exclude = ["docs/automodapi", "plasmapy/_dev"]
namespaces = false
[tool.setuptools_scm]
write_to = "plasmapy/_version.py"
[tool.pytest.ini_options]
minversion = "7.0.1"
testpaths = ['plasmapy']
norecursedirs = ['build', 'docs', 'plasmapy[\/]_dev']
xfail_strict = true
doctest_optionflags = """
NORMALIZE_WHITESPACE
ELLIPSIS
NUMBER"""
addopts = "--doctest-modules --doctest-continue-on-failure"
filterwarnings = [
"ignore:.*deprecated in traitlets 4.2.*:DeprecationWarning",
"ignore:.*MultiIndex.*:DeprecationWarning", # https://github.com/PlasmaPy/PlasmaPy/issues/2319
]
[tool.coverage.report]
exclude_lines = [
"coverage: ignore",
"ImportError",
"ModuleNotFoundError",
"@vectorize",
"@numba.vectorize",
"@numba.jit",
"@jit",
"@numba.njit",
"@njit",
"@abstractmethod",
]
[tool.coverage.run]
omit = [
"ci-helpers/*",
"*/tests/*",
"plasmapy/utils/calculator/*",
"plasmapy/version.py",
"plasmapy/_dev/*",
]
[tool.build_docs]
source-dir = "docs"
build-dir = "docs/_build"
all_files = "1"
[tool.codespell]
skip = "*.png,*cache*,*egg*,.git,.hypothesis,.idea,.tox,_build,*charged_particle*.ipynb,venv"
# Add false positives found by codespell to ignore-words-list
ignore-words-list = """
aas,
aci,
afe,
ans,
ba,
bale,
bu,
circularly,
ded,
dne,
ect,
explin,
fo,
fof,
gud,
hax,
hist,
hve,
nd,
noo,
nwo,
ot,
recuse,
ro,
te,
ue,
ue,
windo"""
[tool.gilesbot]
[tool.gilesbot.pull_requests]
enabled = true
[tool.gilesbot.towncrier_changelog]
enabled = true
changelog_skip_label = "no changelog entry needed"
help_url = "https://docs.plasmapy.org/en/latest/contributing/changelog_guide.html#adding-a-changelog-entry"
changelog_missing = "Missing changelog entry (see `changelog/README.rst`)"
changelog_missing_long = "Please add a changelog entry at `changelog/NUMBER.TYPE.rst`, where `NUMBER` is the pull request number and `TYPE` is one of `feature`, `trivial`, `doc`, `internal`, `bugfix`, `breaking`, or `removal`.\n\nMinor pull requests, such as typo fixes and hyperlink updates, do not need a changelog entry.\n\nFor details, see: https://docs.plasmapy.org/en/latest/contributing/changelog_guide.html#adding-a-changelog-entry"
verify_pr_number = true
number_incorrect = "Changelog entry number ≠ PR number (see `changelog/README.rst`)"
number_incorrect_long = "The changelog entry number does not match this pull request's number.\n\nWhen purposefully editing the changelog entry for a different pull request, set the 'no changelog entry needed' label to ignore this check."
type_incorrect = "Incorrect changelog type (see `changelog/README.rst`)"
type_incorrect_long = "The filename of the changelog entry must be of the form `changelog/NUMBER.TYPE.rst` where `TYPE` is one of `feature`, `trivial`, `doc`, `internal`, `bugfix`, `breaking`, or `removal`.\n\nFor details, see: https://docs.plasmapy.org/en/latest/contributing/changelog_guide.html#adding-a-changelog-entry"
[tool.ruff]
target-version = "py310"
namespace-packages = [".github/workflows", "docs"]
output-format = "grouped"
show-fixes = true
extend-exclude = [
"docs/plasmapy_sphinx",
".idea",
".hypothesis",
".jupyter",
"__pycache__",
"_dev",
]
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
[tool.ruff.lint]
extend-select = [
"A", # flake8-builtins
"ANN204", # missing-return-type-special-method
"ANN205", # missing-return-type-static-method
"ANN206", # missing-return-type-class-method
"ARG", # flake8-unused-arguments
"ASYNC", # flake8-async
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe
"COM818", # trailing-comma-on-bare-tuple
"D", # pydocstyle
"DTZ", # flake8-datetimez
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FA102", # flake8-required-type-annotation
"FBT003", # flake8-boolean-trap
"FIX", # flake8-fixme
"FLY", # flynt
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"NPY", # numpy-deprecated-type-alias
"PD", # pandas-vet
"PERF", # perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PLC", # pylint convention
"PLE", # pylint errors
"PLR", # pylint refactorings
"PLW", # pylint warnings
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"RET", # flake8-return
"RSE", # flake8-raise
"RUF005", # collection-literal-concatenation
"RUF006", # asyncio-dangling-task
"RUF007", # pairwise-over-zipped
"RUF008", # mutable-dataclass-default
"RUF009", # function-call-in-dataclass-default-argument
"RUF010", # explicit-f-string-type-conversion
"RUF013", # implicit-optional
"RUF015", # unnecessary-iterable-allocation-for-first-element
"RUF016", # invalid-index-type
"RUF100", # unused-noqa
"RUF200", # invalid-pyproject-toml
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
"T", # flake8-print
"T100", # debugger
"TCH", # flake8-type-checking
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
ignore = [
"B028", # no-explicit-stacklevel
"D105", # undocumented-magic-method (enable later?)
"D200", # fits-on-one-line (incompatible with multiline short summaries)
"D202", # no-blank-line-after-function
"D205", # blank-line-after-summary (incompatible with multiline short summaries)
"D206", # indent-with-spaces (formatter conflict)
"D401", # non-imperative-mood (enable later?)
"E501", # line-too-long
"EM101", # raw-string-in-exception (enable later in focused PR)
"EM102", # f-string-in-exception (enable later in focused PR)
"FIX002", # line-contains-todo
"ISC001", # single-line-implicit-string-concatenation (formatter conflict)
"N802", # invalid-function-name
"N803", # invalid-argument-name
"N806", # non-lowercase-variable-in-function
"N816", # mixed-case-variable-in-global-scope
"PERF203", # try-except-in-loop (remove when we require Python ≥ 3.11)
"PLE0605", # invalid-all-format (flags `__all__ += __lite_funcs`, etc.)
"PLR0913", # too-many-arguments
"PLR2004", # magic-value-comparison
"PT007", # pytest-parametrize-values-wrong-type
"PT011", # pytest-raises-too-broad
"PT012", # pytest-raises-multiple-statements (enable later?)
"PT019", # pytest-fixture-param-without-value (enable later?)
"PYI024", # collections-named-tuple (enable later)
"RET501", # unnecessary-return-none
"RET502", # implicit-return-value
"RET505", # superfluous-else-return (enable later?)
"RET506", # superfluous-else-raise (enable later?)
"S101", # asserts
"SIM117", # multiple-with-statements (remove for Python 3.10+)
"SIM300", # yoda-conditions
"TD002", # missing-todo-author
"TD003", # missing-todo-link
"TRY003", # raise-vanilla-args
"TRY301", # raise-within-try
"UP025", # unicode-kind-prefix
"W191", # tab-indentation (formatter conflict)
]
dummy-variable-rgx = "Z|mass_numb|request|event"
ignore-init-module-imports = true
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
ignore-fully-untyped = true
mypy-init-return = true
suppress-dummy-args = true
suppress-none-returning = true
[tool.ruff.lint.flake8-import-conventions]
banned-from = [
"astropy.units",
"matplotlib.pyplot",
"numpy",
"pytest",
"warnings",
]
[tool.ruff.lint.flake8-import-conventions.aliases]
"astropy.constants" = "const"
"astropy.units" = "u"
"matplotlib" = "mpl"
"matplotlib.pyplot" = "plt"
numpy = "np"
pandas = "pd"
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"typing.Callable".msg = "Deprecated alias. Change to collections.abc.Callable"
"typing.Collection".msg = "Deprecated alias. Change to collections.abc.Collection"
"typing.DefaultDict".msg = "Deprecated alias. Change to collections.defaultdict"
"typing.Dict".msg = "Deprecated alias. Change to dict"
"typing.Generator".msg = "Deprecated alias. Change to collections.abc.Generator"
"typing.Iterable".msg = "Deprecated alias. Change to collections.abc.Iterable"
"typing.Iterator".msg = "Deprecated alias. Change to collections.abc.Iterator"
"typing.List".msg = "Deprecated alias. Change to list"
"typing.Mapping".msg = "Deprecated alias. Change to collections.abc.mapping"
"typing.MutableMapping".msg = "Deprecated alias. Change to collections.abc.MutableMapping"
"typing.Sequence".msg = "Deprecated alias. Change to collections.abc.Sequence"
"typing.Set".msg = "Deprecated alias. Change to set"
"typing.Tuple".msg = "Deprecated alias. Change to tuple"
"typing.Type".msg = "Deprecated alias. Change to type"
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["D104", "E402", "F401", "F402", "F403"] # ignore import errors
".github/scripts/*.py" = ["D103", "INP001"]
"docs/conf.py" = ["D100", "D103", "E402", "EXE001", "EXE005", "F401"]
"plasmapy/analysis/fit_functions.py" = ["D301"]
"plasmapy/formulary/braginskii.py" = ["C901", "RET503", "RET504"]
"plasmapy/formulary/tests/test_distribution.py" = ["ARG005"]
"plasmapy/particles/tests/test_decorators.py" = ["ARG001", "ARG002"]
"plasmapy/plasma/sources/*.py" = ["D102"]
"plasmapy/utils/_pytest_helpers/pytest_helpers.py" = ["BLE001", "PLR", "SLF001"]
"plasmapy/utils/_pytest_helpers/tests/test_pytest_helpers.py" = ["BLE001", "TRY002"]
"plasmapy/utils/decorators/tests/test_converters.py" = ["ARG001", "ARG005"]
"setup.py" = ["D100"]
"test_*" = ["D100", "D101", "D102", "D103", "D104", "D209", "D400", "D401", "N801", "SLF001"]
"*/*/tests/__init__.py" = ["D104"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.towncrier]
package = "plasmapy"
name = "PlasmaPy"
filename = "CHANGELOG.rst"
directory = "changelog/"
title_format = "{name} v{version} ({project_date})"
issue_format = ":pr:`{issue}`" # Despite the name mismatch, we use this for linking to PRs
wrap = true
[[tool.towncrier.type]]
directory = "feature"
name = "New Features"
showcontent = true
[[tool.towncrier.type]]
directory = "doc"
name = "Documentation Improvements"
showcontent = true
[[tool.towncrier.type]]
directory = "breaking"
name = "Backwards Incompatible Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "removal"
name = "Deprecations and Planned Removals"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "internal"
name = "Internal Changes and Refactorings"
showcontent = true
[[tool.towncrier.type]]
directory = "trivial"
name = "Additional Changes"
showcontent = true