-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
230 lines (209 loc) · 6.52 KB
/
pyproject.toml
File metadata and controls
230 lines (209 loc) · 6.52 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
# https://peps.python.org/pep-0517/
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
# https://hatch.pypa.io/latest/config/metadata/
[tool.hatch.version]
source = "vcs"
# read more about configuring hatch at:
# https://hatch.pypa.io/latest/config/build/
[tool.hatch.build.targets.wheel]
only-include = ["src"]
sources = ["src"]
# https://peps.python.org/pep-0621/
[project]
name = "scenex"
dynamic = ["version"]
description = "Declarative scene graph model and backend abstraction."
readme = "README.md"
requires-python = ">=3.10"
license = { text = "BSD-3-Clause" }
authors = [{ name = "Talley Lambert", email = "talley.lambert@gmail.com" }]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"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",
"Typing :: Typed",
]
dependencies = ["cmap>=0.5", "numpy>=1.24", "psygnal>=0.11.1", "pydantic>=2.10", "pylinalg"]
[project.optional-dependencies]
jupyter = [
"ipywidgets >=8.0.5",
"jupyter >=1.1",
# TODO: Enforce a minimum bound once >1.0.2 released
"jupyter_rfb >=0.3.3, <= 0.5.4",
# Note that this dep is only needed for Vispy, something like simplejpeg would work fine if just pygfx.
"glfw",
# Otherwise jupyter_rfb will use PNG, which is apparently slower
"simplejpeg",
]
pyqt6 = [
"pyqt6 >=6.4,!=6.6",
"pyqt6 >=6.5.3; python_version >= '3.12'",
"qtpy >=2",
]
wx= [
"wxpython >=4.2.2",
]
pygfx = [
# Needed for per-material blending modes
"pygfx>=0.13.0",
# Needed to correctly resizes wx widgets
"rendercanvas>=2.5.1"
]
vispy = ["vispy>=0.15.0", "pyopengl"]
# This extra is a mess!
# Our source code for the pygfx adaptors relies on pygfx>=0.13.0 (see that extra for why).
# However no versions of imgui-bundle that I'm aware of work for pygfx v0.13.0, because each version of pygfx
# is tied to a range of versions of wgpu-py. The wgpu-py imgui renderer is broken until wgpu>=0.27.0, which
# corresponds to pygfx>=0.15.2. So, if you don't care about imgui, you can run pygfx>=0.13.0, but if you want
# it, you'll need pygfx>=0.15.2 so that you can get wgpu>=0.27.0.
# Note that it's unclear to me why pygfx v0.15.0 does not work, because the fixes should be a part of that release.
# See https://github.com/pygfx/wgpu-py/pull/725
imgui = [
# Pulls in a wgpu>=0.27 which is needed to work with this version of imgui-bundle
"pygfx>=0.15.2",
# Earlier versions of imgui-bundle don't work with pygfx>=0.13.0
"imgui-bundle>=1.92.0",
]
[dependency-groups]
test = ["pytest>=8", "pytest-cov>=6"]
testqt = [{ include-group = "test" }, "pytest-qt >=4.4"]
testjupyter = [{ include-group = "test" }, "nbval"]
docs = [
"mike>=2.1.3",
"mkdocs>=1.6.1",
"mkdocs-api-autonav>=0.2.1",
"mkdocs-material>=9.6.12",
"mkdocs-minify-plugin>=0.8.0",
"mkdocs-spellcheck[all]>=1.1.1",
"mkdocstrings-python>=1.16.10",
]
dev = [
{ include-group = "test" },
{ include-group = "docs" },
"scenex[pygfx,vispy,imgui,jupyter,pyqt6, wx]",
"imageio[tifffile] >=2.20",
"ipython",
"mypy",
"pdbpp; sys_platform != 'win32'",
"pre-commit-uv",
"rich",
"ruff",
"pyright>=1.1.392",
]
[project.urls]
homepage = "https://github.com/pyapp-kit/scenex"
repository = "https://github.com/pyapp-kit/scenex"
# https://docs.astral.sh/ruff
[tool.ruff]
line-length = 88
target-version = "py310"
fix = true
unsafe-fixes = true
src = ["src"]
exclude = ["_stubs"]
# https://docs.astral.sh/ruff/rules
[tool.ruff.lint]
pydocstyle = { convention = "numpy" }
select = [
"E", # style errors
"W", # style warnings
"F", # flakes
"D", # pydocstyle
"D417", # Missing argument descriptions in Docstrings
"I", # isort
"UP", # pyupgrade
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A001", # flake8-builtins
"RUF", # ruff-specific rules
"TC", # flake8-type-checking
"TID", # flake8-tidy-imports
]
ignore = [
"D401", # First line should be in imperative mood
"D100", # Missing docstring in public module
"D105", # Missing docstring in magic method
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S"]
# https://docs.astral.sh/ruff/formatter/
[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = false # default is false
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "src/**/"
strict = true
disallow_any_generics = false
disallow_subclassing_any = false
show_error_codes = true
pretty = true
plugins = ["pydantic.mypy"]
untyped_calls_exclude = ["rendercanvas", "IPython", "pytestqt"]
# Conflicts with pydantic type coercion
disable_error_code = ["assignment"]
[[tool.mypy.overrides]]
module = ["rendercanvas.*"]
follow_untyped_imports = true
[[tool.mypy.overrides]]
module = ["pygfx.*", "vispy.*", "wgpu.*", "pylinalg.*", "qtpy.*", "ipywidgets.*", "IPython.*", "jupyter", "jupyter_rfb.*", "wx.*", "pytestqt.*"]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = false
init_typed = false
warn_required_dynamic_aliases = true
[tool.pyright]
include = ["src"]
pythonVersion = "3.10"
enableExperimentalFeatures = true
# Conflicts with pydantic type coercion
reportAttributeAccessIssue = false
# Conflicts with pydantic type coercion
reportArgumentType = false
verboseOutput = true
venv = ".venv"
# https://docs.pytest.org/
[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"--color=yes",
# This tells pytest to run doctest within python modules
"--doctest-modules",
# This allows doctest to skip python modules that error on import
# in our case, this will avoid import errors from backend-specific modules.
"--doctest-ignore-import-errors",
]
testpaths = [
"tests",
"src",
]
doctest_optionflags = ["ELLIPSIS", "NORMALIZE_WHITESPACE"]
filterwarnings = [
"error",
"ignore:'count' is passed as positional argument::vispy",
]
# https://coverage.readthedocs.io/
[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"except ImportError",
"\\.\\.\\.",
"raise NotImplementedError()",
"pass",
]
[tool.coverage.run]
source = ["scenex"]
[tool.check-manifest]
ignore = [".pre-commit-config.yaml", ".ruff_cache/**/*", "tests/**/*"]
[tool.typos.default]
extend-ignore-identifiers-re = ["(?i)nd?.*", "ser_schema"]