-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
177 lines (152 loc) · 4.57 KB
/
pyproject.toml
File metadata and controls
177 lines (152 loc) · 4.57 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
[build-system]
requires = ["hatch-vcs", "hatch-cython>=0.6.0", "cherab==1.5.*"]
build-backend = "hatchling.build"
[project]
name = "cherab-imas"
description = "Cherab spectroscopy framework: IMAS submodule"
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", "IMAS", "imas", "tokamak", "fusion", "plasma"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: Unix",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Cython",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"cherab==1.5.*",
"imas-python[netcdf]",
"typing-extensions; python_version < '3.12'",
]
dynamic = ["version"]
[project.optional-dependencies]
test = ["pytest", "pytest-cov", "pooch", "rich", "plotly"]
[project.urls]
Homepage = "https://github.com/cherab"
Documentation = "https://cherab.github.io/imas/"
Repository = "https://github.com/cherab/imas"
Issues = "https://github.com/cherab/imas/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/imas" = "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 = true
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.imas"]
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.imas' --cov-report term-missing --no-cov-on-fail"
# ------------------------------
# === Lint & Format settings ===
# ------------------------------
[tool.ruff]
line-length = 100
[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
"D", # pydocstyle
"DOC", # pydoclint
]
preview = true
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
"D107", # missing docstring in __init__
]
[tool.ruff.lint.isort]
known-first-party = ["cherab"]
[tool.ruff.lint.per-file-ignores]
"**/*.ipynb" = [
"W292",
"D",
"DOC",
] # no newline at end of file and skip docstring checks
"tests/**" = ["D", "DOC"] # skip docstring checks in tests
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.format]
docstring-code-format = true
[tool.cython-lint]
max-line-length = 100
# ------------------------------
# === Type checking settings ===
# ------------------------------
[tool.mypy]
files = ["src"]
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "truthy-bool"]
disable_error_code = ["no-any-return"]
plugins = ["numpy.typing.mypy_plugin"]
[tool.pyrefly]
project-includes = ["src"]