-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpyproject.toml
More file actions
251 lines (230 loc) · 8.19 KB
/
Copy pathpyproject.toml
File metadata and controls
251 lines (230 loc) · 8.19 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
247
248
249
250
251
[build-system]
build-backend = 'mesonpy'
requires = ["meson-python",
"meson>=1.6",
"ninja",
"packaging",
"numpy>=1.24.0"]
[tool.meson-python.args]
setup = ['--vsenv', '-Dpython_only=false']
[project]
name = "Euphonic"
description = "Euphonic calculates phonon bandstructures and inelastic neutron scattering intensities from modelling code output (e.g. CASTEP)"
requires-python = ">=3.10"
readme = "README.rst"
license = {text = "GPLv3"}
keywords = [
"Python",
"physics",
"phonons",
"inelastic neutron scattering",
"CASTEP",
"Phonopy",
"force constants"
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: C",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
"packaging",
"numpy>=1.24.0",
"scipy>=1.10",
"seekpath>=2.2.1,<3",
"spglib>=2.1.0",
"pint>=0.22",
"threadpoolctl>=3.0.0",
"toolz>=0.12.1",
"typing_extensions~=4.0"
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/pace-neutrons/Euphonic"
Repository = "https://github.com/pace-neutrons/Euphonic.git"
"Bug Tracker" = "https://github.com/pace-neutrons/Euphonic/issues"
documentation = "https://euphonic.readthedocs.io/en/stable/"
[dependency-groups]
min_reqs = [
"numpy==1.24.0",
"scipy==1.10.0",
"spglib==2.1.0",
"seekpath==2.2.1",
"pint==0.22",
"matplotlib==3.8",
# h5py 3.6 has no wheels for Linux ARM or macOS; use 3.7 there instead.
"h5py==3.6; sys_platform != 'darwin' and (sys_platform != 'linux' or platform_machine not in 'aarch64 arm64')",
"h5py==3.7; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine in 'aarch64 arm64')",
"PyYAML==6.0",
"threadpoolctl==3.0.0",
"toolz==0.12.1"
]
test = ["mock", "pytest>=9.0.3,<10.0", "pytest-cov", "pytest-mock", "pytest-lazy-fixtures", "pytest-xdist", "pytest-xvfb", "python-slugify"]
ci = ["tox==4.30.3"]
docs = [
"numpy==2.2.6",
"setuptools==83.0.0",
"sphinx~=8.1.0",
"sphinx-argparse==0.5.2",
"sphinx-rtd-theme==3.1.0",
"wheel==0.47.0",
]
dev = [
{include-group = "test"},
{include-group = "ci"},
]
[project.optional-dependencies]
matplotlib = ["matplotlib>=3.8.0"]
phonopy-reader = ["h5py>=3.6.0", "PyYAML>=6.0"]
# brille build on ARM-Linux is currently a bad time; skip it so tests run properly
brille = ["brille>=0.7.0; sys_platform != 'linux' or platform_machine not in 'aarch64 arm64'"]
[project.scripts]
euphonic-brille-convergence = "euphonic.cli.brille_convergence:main"
euphonic-dispersion = "euphonic.cli.dispersion:main"
euphonic-dos = "euphonic.cli.dos:main"
euphonic-optimise-dipole-parameter = "euphonic.cli.optimise_dipole_parameter:main"
euphonic-show-sampling = "euphonic.cli.show_sampling:main"
euphonic-intensity-map = "euphonic.cli.intensity_map:main"
euphonic-powder-map = "euphonic.cli.powder_map:main"
[tool.uv]
conflicts = [
[{group = 'min_reqs'}, {group = 'docs'}],
[{group = 'min_reqs'}, {group = 'dev'}],
]
[tool.pytest.ini_options]
markers = [
"brille: test requires 'brille' extra",
"c_extension: test requires C extension to be available",
"matplotlib: test requires 'matplotlib' extra",
"multiple_extras: test requires multiple extras to be installed",
"phonopy_reader: test requires 'phonopy-reader' extra",
"vasp_reader: test requires 'phonopy-reader' extra",
]
[tool.ruff]
line-length = 79
extend-exclude = ["doc/source/conf.py"]
[tool.ruff.lint]
preview = true
explicit-preview-rules = true
select = [
"ERA001", # Eradicate commented-out code
"YTT", # Flake8-2020
# "ANN", # Full type annotation, not realistic right now
"ASYNC",
"S", # Security (flake8-bandit)
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap: don't use positional boolean arguments. Fixable, but API-breaking.
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FIX", # flake8-fixme (leftover FIXME, TODO etc.)
"FA", # flake8-future-annotations
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
# "PYI", # flake8-pyi : requires typing_extensions or python3.11
# "PT", # flake8-pytest-style : good stuff, worth its own PR
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
# "SLF", # flake8-self : would be good to take a closer look at some of this private attribute access
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"TID", # flake8-tidy-imports
"TD", # flake8-todos
"TC", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"FLY", # flynt
"I", # isort
"C90", # mccabe : code complexity metric
"NPY", # NumPy-specific rules
"N", # pep8-naming
"PERF", # Perflint
"F401", # unused-import
"E", # pycodestyle error
"W", # pycodestyle warning
"DOC", # pydoclint
# "D", # 2000 errors, code sprint material?
"F",
"PGH", # pygrep-hooks
"PLC", # pylint convention
"PLE", # pylint error
# "PLR", # pylint refactor; 71 errors, own PR needed
"PLR0203", # no-staticmethod-decorator
"PLR5501", # collapsible-else-if
"PLW", # pylint warning
"UP", # pyupgrade
"FURB", # refurb
"RUF", # Ruff-specific rules
"TRY", # tryceratops
]
ignore = [
"S101", # Use of except
"COM812", # Trailing comma, conflicts with ruff format
"CPY001", # Missing copyright notice at top of every file. Not for us.
"T20", # flake8-print forbids use of print and pprint.
"PERF203", # No try-except in loop. Micro-optimisation, not relevant for Py 3.11+
"PLE1300", # Pint introduces format character P, ruff doesn't recognise it
"PTH123", # Replace with Path.open()
]
task-tags = ["Note"] # Avoid false positives for ERA001 on lines like "# Note: CODE-LIKE-THINGS"
[tool.ruff.lint.flake8-bugbear]
# Allow default arguments like, e.g., `width: Quantity = Quantity(0.01, 'meV')`.
extend-immutable-calls = ["euphonic.Quantity", "euphonic.ureg.Quantity"]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
[tool.ruff.lint.isort]
force-sort-within-sections = true
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["k_B", "H_ab", "Q"]
[tool.ruff.lint.per-file-ignores]
"build_utils/*" = ["E501"] # Long lines
"tests_and_analysis/test/**/*" = [
"ARG", # pytest fixtures can look like unused arguments
"RUF012", # declaring sample data inside test classes is tidy
"E501", # long lines seem more common with verbose test names
]
"tests_and_analysis/test/run_tests.py" = ["FBT"] # Boolean positional arg; not public API, low risk
"euphonic/isotopes/_legacy.py" = ["PLC0415"] # Imports inside functions to avoid loop
"euphonic/version.py" = ["Q000"] # Source build prefers double quotes here
[tool.ruff.format]
# Prefer single quotes over double quotes.
quote-style = "single"
[tool.coverage.run]
branch = true
source = ["euphonic"]
parallel = true
data_file = ".coverage"
relative_files = true
[tool.coverage.paths]
source = [
"euphonic",
"*/site-packages/euphonic",
"*/*/euphonic/.tox/*/lib/python*/site-packages/euphonic",
".tox/*/lib/python*/site-packages/euphonic",
".tox/*/Lib/site-packages/euphonic",
]
[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"@overload",
"if TYPE_CHECKING:",
]
[tool.coverage.xml]
output = "coverage.xml"