-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpyproject.toml
179 lines (159 loc) · 3.99 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
[build-system]
# keep in sync with dependency-groups
requires = [
"meson-python>=0.17.1",
"Cython>=3.0",
"numpy>=1.25.0",
]
build-backend = "mesonpy"
[project]
name = "gpgi"
version = "2.0.0"
description = "A Generic Particle+Grid Interface"
authors = [
{ name = "C.M.T. Robert" },
]
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.11"
dependencies = [
# keep in sync with build-time requirements (dev group)
# keep in sync with NPY_TARGET_VERSION (meson.build)
"numpy>=1.25, <3",
]
[project.readme]
file = "README.md"
content-type = "text/markdown"
[project.license]
text = "GPL-3.0"
[project.urls]
Homepage = "https://github.com/neutrinoceros/gpgi"
Changelog = "https://github.com/neutrinoceros/gpgi/blob/main/CHANGELOG.md"
[dependency-groups]
test = [
"matplotlib>=3.6.0",
"pytest-mpl>=0.16.1",
"pytest>=7.0.0",
]
covcheck = [
{include-group = "test"},
"coverage>=7.6.1",
]
concurrency = [
{include-group = "test"},
"pytest-repeat>=0.9.3",
]
typecheck = [
"mypy>=1.13.0",
"pyright>=1.1.391",
]
# For convenience, the dev group contains build time requirements because
# - meson-python supports editable installs or build isolation, but not both
# - uv special cases this group name and includes it by default via uv sync
#
# Combined with no-build-isolation set in [tool.uv],
# this allows to bootstrap an editable in just two simple steps:
# uv sync --only-dev && uv sync
#
# This could be simplified/reunifed depending on what happens on the following
# upstream issue
# https://github.com/astral-sh/uv/issues/7052
#
# ninja is a system level requirement to meson-python
# it is automatically obtained from PyPI if lacking at the system level
# when building a package in isolation, which is why it's not listed
# under build-system requires.
dev = [
"meson-python>=0.17.1",
"ninja>=1.11.1.3",
"Cython>=3.0.12",
"numpy>=1.25.0, <3", # keep in sync with runtime requirement
]
[tool.uv]
no-build-isolation-package = ["gpgi"]
[tool.coverage.run]
source = [
"src/gpgi",
"tests",
]
omit = [
"src/gpgi/_backports.py",
"src/gpgi/_typing.py",
]
[tool.coverage.report]
show_missing = true
skip_covered = false
exclude_lines = [
# a more strict default pragma
"\\# pragma: no cover\\b",
# allow defensive code
"^\\s*raise NotImplementedError\\b",
# typing-related code
"^if TYPE_CHECKING:",
": \\.\\.\\.(\\s*#.*)?$",
"^ +\\.\\.\\.$",
"-> ['\"]?NoReturn['\"]?:",
]
[tool.ruff.lint]
ignore = ["E501", "D101"]
select = [
"E",
"F",
"W",
"D", # pydocstyle
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"TCH", # flake8-type-checking
"YTT", # flake8-2020
"I", # isort
"UP", # pyupgrade
"NPY", # numpy specific rules
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["gpgi"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D"]
"_backports.py" = ["D"]
[tool.mypy]
python_version = "3.11"
show_error_codes = true
pretty = true
warn_return_any = true
warn_unused_configs = true
warn_unreachable = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
exclude = [
"gpgi/lib",
"gpgi/_backports"
]
follow_imports = "silent"
[tool.pytest.ini_options]
filterwarnings = [
"error",
'ignore:Matplotlib is currently using agg, which is a non-GUI backend:UserWarning',
]
addopts = "-ra"
[tool.cibuildwheel]
build = "cp311-* cp312-* cp313-*"
build-frontend = "build[uv]"
build-verbosity = 1
test-groups = ["test", "concurrency"]
test-command = [
"pytest --color=yes {project}/tests",
"pytest --color=yes --count 500 {project}/tests/test_concurrent.py",
]
test-skip = "*-musllinux*"
[tool.cibuildwheel.linux]
archs = "x86_64"
[tool.cibuildwheel.macos]
archs = "auto64"
[tool.cibuildwheel.windows]
archs = "AMD64"