-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
197 lines (169 loc) · 5.11 KB
/
pyproject.toml
File metadata and controls
197 lines (169 loc) · 5.11 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
[build-system]
requires = [
"hatchling",
"hatch-vcs",
"hatch-cython>=0.6.0rc0",
"numpy",
"cherab-imas",
]
build-backend = "hatchling.build"
[project]
name = "cherab-iter"
description = "Cherab spectroscopy framework, ITER subpackage"
authors = [
{ name = "munechika-koyo", email = "munechika.koyo@gmail.com" },
{ name = "vsnever" },
{ name = "jacklovell" },
]
readme = "README.md"
requires-python = ">=3.10"
license = "EUPL-1.1"
license-files = ["LICEN[CS]E.*"]
keywords = ["cherab", "ITER", "tokamak", "fusion", "plasma"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = ["cherab-imas", "platformdirs", "rich"]
dynamic = ["version"]
[project.optional-dependencies]
test = ["pytest", "pytest-cov", "cherab-imas[test]"]
[project.urls]
Homepage = "https://github.com/cherab"
# Documentation = "https://cherab.github.io/cherab-iter"
Repository = "https://github.com/cherab/iter"
Issues = "https://github.com/cherab/iter/issues"
# ----------------------
# === Version config ===
# ----------------------
[tool.hatch.version]
source = "vcs"
[tool.hatch.metadata.hooks.vcs]
# ----------------------------
# === Build/Package config ===
# ----------------------------
[tool.hatch.build.targets.wheel]
packages = ["src/cherab"]
artifacts = ["*.so", "*.pyd", "*.dylib"]
exclude = ["*.pyx", "cherab/__init__.pxd"]
[tool.hatch.build.targets.wheel.shared-data]
"share/cherab/demos/iter" = "demos/*"
[tool.hatch.build.targets.wheel.hooks.cython]
dependencies = ["hatch-cython"]
[tool.hatch.build.targets.wheel.hooks.cython.options]
src = "cherab"
include_numpy = true
compile_py = false
parallel = false
compile_args = ["-O3"]
env = [
{ env = "LDFLAGS", arg = "-headerpad_max_install_names", platforms = [
"darwin",
], arch = [
"x86_64",
], merges = true },
]
define_macros = [["NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"]]
[tool.hatch.build.targets.wheel.hooks.cython.options.files]
targets = ["**/*.pyx"]
[tool.cibuildwheel]
skip = "pp* *_ppc64le *_i686 *_s390x *-musllinux* cp313-* cp314-* cp314t-*" # TODO: add cp313/314 when cherab supports it
build-frontend = "build[uv]"
test-extras = ["test"]
test-command = "pytest {project}/tests"
# -----------------------
# === Cov/Test config ===
# -----------------------
[tool.coverage.run]
source_pkgs = ["cherab.iter"]
branch = true
parallel = true
[tool.coverage.paths]
test = ["src/test", "*/test/src/test"]
tests = ["tests", "*/test/tests"]
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--cov=cherab.iter --cov-report term-missing --no-cov-on-fail"
# ------------------------------
# === Lint & Format settings ===
# ------------------------------
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"B", # flake8-bugbear
"F", # pyflakes
"I", # isort (import order)
"N", # pep8-naming
"W", # Warning
"UP", # pyupgrade
"NPY", # numpy specific rules
]
ignore = [
# Recommended ignores by ruff when using formatter
"E501", # line too long
"N803", # argument name should be lowercase
"N806", # variable in function should be lowercase
]
[tool.ruff.lint.per-file-ignores]
"**/*.ipynb" = ["W292"] # no newline at end of file
[tool.ruff.lint.isort]
known-first-party = ["cherab"]
[tool.ruff.format]
docstring-code-format = true
[tool.cython-lint]
max-line-length = 100
[tool.docformatter]
recursive = true
wrap-summaries = 100
wrap-descriptions = 100
blank = false
[tool.numpydoc_validation]
checks = [
"all", # report on all checks, except the below
"GL01", # Docstring text (summary) should start in the line immediately
"EX01", # No examples section found
"SA01", # See Also section not found
"ES01", # No extended summary found
"GL08", # The object does not have a docstring
"RT01", # No Returns section found
"PR01", # Parameters {missing_params} not documented
"SS06", # Summary should fit in a single line
]
# remember to use single quotes for regex in TOML
exclude = [ # don't report on objects that match any of these regex
'\.__repr__$',
]
override_SS05 = ['^Process ', '^Assess ', '^Access ']
# ------------------------------
# === Type checking settings ===
# ------------------------------
[tool.mypy]
files = ["src", "tests"]
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "truthy-bool"]
disable_error_code = ["no-any-return"]
[tool.basedpyright]
include = ["src", "tests"]
pythonPlatform = "All"
typeCheckingMode = "all"
reportMissingTypeStubs = true
# no raysect/cherab type stubs; pytest fixtures
reportUnknownMemberType = false
reportUnknownVariableType = false
# ruff handles this
reportUnusedParameter = false