-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathpyproject.toml
More file actions
224 lines (192 loc) · 5.26 KB
/
pyproject.toml
File metadata and controls
224 lines (192 loc) · 5.26 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
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0
[build-system]
requires = [
"scikit-build-core",
"pgm-build-dependencies@https://github.com/PowerGridModel/pgm-build-dependencies/releases/latest/download/pgm_build_dependencies-0.1.0-py3-none-any.whl",
]
build-backend = "scikit_build_core.build"
[project]
name = "power-grid-model"
authors = [
{ name = "Contributors to the Power Grid Model project", email = "powergridmodel@lfenergy.org" },
]
description = "Python/C++ library for distribution power system analysis"
readme = "README.md"
license = "MPL-2.0"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: C++",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Topic :: Scientific/Engineering :: Physics",
]
requires-python = ">=3.12"
dependencies = ["numpy>=2.0.0"]
dynamic = ["version"]
[dependency-groups]
test = ["pytest", "pytest-cov", "msgpack"]
lint = [
"pre-commit",
"ruff",
"mypy",
"numpy", # needed for mypy
"gersemi", # CMake linter
"clang-format ~= 18.0", # C++ formatter
]
example = ["ipykernel"]
dev = [
{ include-group = "test" },
{ include-group = "lint" },
{ include-group = "example" },
]
code-generation = ["dataclasses_json", "jinja2"]
doc = [
"sphinx",
"breathe",
"myst_nb",
"sphinx_rtd_theme",
"readthedocs-sphinx-search",
"sphinxcontrib-mermaid>=1.0.0",
"sphinxcontrib-tikz",
"numpydoc",
"pandas",
"gitpython",
"pylint",
]
[project.urls]
Home-page = "https://lfenergy.org/projects/power-grid-model/"
GitHub = "https://github.com/PowerGridModel/power-grid-model"
Documentation = "https://power-grid-model.readthedocs.io/en/stable/"
Mailing-list = "https://lists.lfenergy.org/g/powergridmodel"
Discussion = "https://github.com/orgs/PowerGridModel/discussions"
[project.entry-points."cmake.root"]
power_grid_model = "power_grid_model._core.power_grid_model_c"
[tool.scikit-build]
logging.level = "INFO"
cmake.version = ">=3.23"
cmake.build-type = "Release"
cmake.args = ["-GNinja"]
build-dir = "build"
search.site-packages = false
ninja.version = ">=1.10"
ninja.make-fallback = false
wheel.install-dir = "power_grid_model/_core/power_grid_model_c"
wheel.py-api = "py3"
[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "VERSION"
regex = "^\\s*(?P<version>[^\\s]+)\\s*$"
result = "{version}"
# when build in CI, force single thread to avoid out of memory errors
[[tool.scikit-build.overrides]]
if.any.env.CIBUILDWHEEL = true
if.any.env.GITHUB_ACTIONS = true
if.any.env.READTHEDOCS = true
build.tool-args = ["-j1"]
[tool.pytest.ini_options]
testpaths = ["tests/unit"]
addopts = [
"--cov=power_grid_model",
"--cov-report=term",
"--cov-report=html:python_cov_html",
"--cov-report=xml:python_coverage.xml",
"--cov-fail-under=95",
]
xfail_strict = true
[tool.ruff]
# Same as Black.
line-length = 120
indent-width = 4
show-fixes = true
# Assume Python 3.12
target-version = "py312"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# isort
"I",
"SIM",
"YTT",
"BLE",
"PERF",
"Q",
"ICN",
"ISC",
"G",
"LOG",
"EXE",
"FA",
"FURB",
"FLY",
"SLOT",
"PL",
"NPY",
"W",
"PTH",
"TID",
"ARG",
"RET",
"PIE",
"SLF",
"UP",
"RSE",
"RUF",
"S",
"FBT003",
"TRY002",
"PT",
]
ignore = [
"PT019", # flags false positives
]
[tool.ruff.lint.isort]
# Imports that are imported using keyword "as" and are from the same source - are combined.
combine-as-imports = true
[tool.ruff.lint.per-file-ignores]
# Ignore `F811` (redefinition violations) in all examples notebooks since we use redefinition.
"docs/examples/*.ipynb" = ["F811", "E402"]
# Pylint was only run in src directory before moving to Ruff
"tests/*" = ["PLR0915", "PLR0912", "PLR0913", "S"]
# Ignore private member access: _model_ptr, _all_component_count...
"src/power_grid_model/_core/*.py" = ["SLF001"]
"tests/unit/test_error_handling.py" = ["SLF001"]
[tool.mypy]
follow_imports = "silent"
ignore_missing_imports = true
show_column_numbers = true
non_interactive = true
install_types = true
# CI build options
[tool.cibuildwheel]
build-frontend = "build[uv]"
build-verbosity = 1
test-groups = ["test"]
test-command = "pytest {package}/tests"
# we do not support
# PyPy
# musllinux in aarch64
# disable Python 3.14 for now until it is released
skip = ["pp*", "*-musllinux_aarch64"]
[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
environment = { CC = "gcc", CXX = "g++" }
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
environment = { CC = "clang", CXX = "clang++", MACOSX_DEPLOYMENT_TARGET = "13.4" }
[tool.cibuildwheel.windows]
archs = ["AMD64"]