Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
270 lines (244 loc) · 8 KB
/
Copy pathpyproject.toml
File metadata and controls
270 lines (244 loc) · 8 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# https://peps.python.org/pep-0517/
[build-system]
requires = ["hatchling>=1.8.0", "hatch-vcs"]
build-backend = "hatchling.build"
# https://peps.python.org/pep-0621/
[project]
name = "psygnal"
description = "Fast python callback/event system modeled after Qt Signals"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "BSD 3-Clause License" }
authors = [{ name = "Talley Lambert", email = "talley.lambert@gmail.com" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"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 :: Python :: 3.15",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
# typing-extensions is in the source code, but not actually required
# at runtime. All uses are guarded by if TYPE_CHECKING
]
# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
proxy = ["wrapt"]
pydantic = ["pydantic"]
[dependency-groups]
test-min = ["pytest>=6.0", "pytest-cov", "pytest-asyncio"]
test = [
{ include-group = "test-min" },
"dask[array]>=2024.0.0",
"attrs",
"numpy >1.21.6",
"pydantic",
"pyinstaller>=4.0",
"wrapt",
"msgspec; python_version < '3.14'",
"toolz",
"anyio",
"trio",
]
test-typing = [{ include-group = "test-min" }, "pytest-mypy-plugins<4; python_version < '3.14'"]
testqt = [{ include-group = "test" }, "pytest-qt", "qtpy"]
test-codspeed = [{ include-group = "test" }, "pytest-codspeed"]
docs = [
"mkdocs-api-autonav",
"mkdocs-material",
"mkdocs-minify-plugin",
"mkdocs-spellcheck[all]",
"mkdocs",
"mkdocstrings-python",
"ruff",
]
dev = [
{ include-group = "test" },
{ include-group = "test-typing" },
{ include-group = "docs" },
"PyQt6",
"ipython",
"mypy >=2.1.0",
"mypy_extensions",
"asv",
"ruff",
"typing-extensions",
"rich>=14.0.0",
"pdbpp; sys_platform != 'win32'",
"pytest-benchmark>=5.1.0",
"prek>=0.4.3",
]
[project.urls]
homepage = "https://github.com/pyapp-kit/psygnal"
repository = "https://github.com/pyapp-kit/psygnal"
documentation = "https://psygnal.readthedocs.io"
[project.entry-points.pyinstaller40]
hook-dirs = "psygnal._pyinstaller_util._pyinstaller_hook:get_hook_dirs"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.sdist]
include = ["src", "tests", "CHANGELOG.md"]
[tool.hatch.build.targets.wheel]
only-include = ["src"]
sources = ["src"]
[tool.hatch.build.targets.wheel.hooks.mypyc]
mypy-args = ["--ignore-missing-imports"]
# NOTE: do not set `options.debug_level = "0"` here to "fix" reproducible builds
# (see #421/#429). It works, but it strips C debug symbols from every wheel we
# ship, which downstream packagers who build -dbgsym packages (e.g. Debian) need
# and have to explicitly restore. The actual source of non-determinism is
# hatch-mypyc's default `tempfile.TemporaryDirectory()` build root, which embeds
# a random path into the compiled .so's debug info on every build. Debian's own
# packaging already fixes this correctly, without touching debug_level, by
# pointing `HATCH_MYPYC_BUILD_DIR` at a fixed, pre-created directory instead of
# the random default (see debian/rules), combined with dpkg's default
# `-ffile-prefix-map` (the `fixfilepath` build flag) to normalize the remaining
# absolute-build-root prefix. Confirmed locally: with a fixed `build-dir` alone
# (no debug_level change), two separate builds embed byte-identical paths.
enable-by-default = false
require-runtime-dependencies = true
dependencies = [
"hatch-mypyc>=0.13.0",
"mypy >=2.1.0",
"mypy_extensions >=0.4.2",
"pydantic!=2.10.0", # typing error in v2.10 prevents mypyc from working
"types-attrs",
"msgspec; python_version < '3.14'",
]
exclude = [
"src/psygnal/__init__.py",
"src/psygnal/_evented_model.py",
"src/psygnal/utils.py",
"src/psygnal/containers",
"src/psygnal/qt.py",
"src/psygnal/_pyinstaller_util",
"src/psygnal/_throttler.py",
"src/psygnal/_async.py",
"src/psygnal/testing.py",
]
[tool.cibuildwheel]
# Skip 32-bit builds & PyPy wheels on all platforms
skip = ["*-manylinux_i686", "*-musllinux_i686", "*-win32", "pp*"]
build = ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*", "cp315-*"]
test-groups = ["test"]
test-command = "pytest {project}/tests -v"
# cp315: pydantic-core has no cp315 wheels before pydantic 2.14, and manylinux has no
# Rust to build it. 3.15 is still covered by the test.yml matrix. Drop once 2.14 is out.
test-skip = ["*-musllinux*", "cp312-win*", "*-macosx_arm64", "cp315-*"]
build-frontend = "build[uv]"
[[tool.cibuildwheel.overrides]]
select = "*-manylinux_i686*"
before-all = "yum install -y python3-devel"
[tool.cibuildwheel.environment]
HATCH_BUILD_HOOKS_ENABLE = "1"
[tool.check-wheel-contents]
# W004: Module is not located at importable path (hook-psygnal.py)
ignore = ["W004"]
# https://docs.astral.sh/ruff/
[tool.ruff]
line-length = 88
target-version = "py310"
src = ["src", "tests"]
[tool.ruff.lint]
pydocstyle = { convention = "numpy" }
select = [
"E", # style errors
"F", # flakes
"W", # warnings
"D", # pydocstyle
"D417", # Missing argument descriptions in Docstrings
"I", # isort
"UP", # pyupgrade
"S", # bandit
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A001", # flake8-builtins
"TC", # flake8-typecheck
"TID", # flake8-tidy-imports
"RUF", # ruff-specific rules
]
ignore = [
"D401", # First line should be in imperative mood
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S", "RUF012"]
"benchmarks/*.py" = ["D", "RUF012"]
# https://docs.astral.sh/ruff/formatter/
[tool.ruff.format]
docstring-code-format = true
# https://docs.pytest.org/en/6.2.x/customize.html
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
asyncio_default_fixture_loop_scope = "function"
addopts = ["--color=yes"]
filterwarnings = [
"error",
"ignore:The distutils package is deprecated:DeprecationWarning:",
"ignore:.*BackendFinder.find_spec()", # pyinstaller import
"ignore:.*not using a cooperative constructor:pytest.PytestDeprecationWarning:",
"ignore:The frame locals reference is no longer cached",
"ignore:Failed to disconnect::pytestqt",
"ignore:.*unclosed.*socket.*:ResourceWarning:", # asyncio internal socket cleanup
"ignore:.*unclosed event loop.*:ResourceWarning:", # asyncio internal event loop cleanup
]
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "src/**/*.py"
strict = true
disallow_any_generics = false
disallow_subclassing_any = false
show_error_codes = true
pretty = true
[[tool.mypy.overrides]]
module = ["numpy.*", "wrapt", "pydantic.*"]
ignore_errors = true
[[tool.mypy.overrides]]
module = ["wrapt"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["tests.*"]
disallow_untyped_defs = false
# https://coverage.readthedocs.io/en/6.4/config.html
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"except ImportError",
"\\.\\.\\.",
"raise NotImplementedError()",
]
show_missing = true
[tool.coverage.run]
source = ["psygnal"]
omit = ["*/_pyinstaller_util/*"]
# https://github.com/mgedmin/check-manifest#configuration
[tool.check-manifest]
ignore = [
".ruff_cache/**/*",
".github_changelog_generator",
".pre-commit-config.yaml",
"tests/**/*",
"typesafety/*",
".devcontainer/*",
".readthedocs.yaml",
"Makefile",
"asv.conf.json",
"benchmarks/*",
"docs/**/*",
"mkdocs.yml",
"src/**/*.c",
"codecov.yml",
"CHANGELOG.md",
]
[tool.typos.default]
extend-ignore-identifiers-re = ["ser_schema"]