-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
209 lines (190 loc) · 6.27 KB
/
Copy pathpyproject.toml
File metadata and controls
209 lines (190 loc) · 6.27 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
# 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 = "cellier"
dynamic = ["version"]
description = "A workshop for rendering cellular models."
readme = "README.md"
requires-python = ">=3.10"
license = { text = "BSD-3-Clause" }
authors = [{ name = "Kevin Yamauchi", email = "kevin.yamauchi@gmail.com" }]
# https://pypi.org/classifiers/
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",
"Typing :: Typed",
]
# add your package dependencies here
dependencies = [
"cmap>=0.6.0",
"einops>=0.8.1",
"numpy<2.5.0",
"psygnal",
"pydantic",
"pygfx>=0.17.0",
"pylinalg>=0.6.7",
"qtpy",
"rendercanvas>=2.7.1",
"scipy>=1.15.2",
"superqt>=0.7.2",
"tensorstore>=0.1.74",
"yaozarrs>=0.2",
"zarr",
]
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
# "extras" (e.g. for `pip install .[test]`)
[project.optional-dependencies]
remote = [
"yaozarrs[io]>=0.2", # includes fsspec for S3/GCS/HTTP metadata reading
]
pyside = ["PySide6"]
pyqt = ["PyQt6"]
# anywidget front-end (notebook hosts: Jupyter, marimo). ipywidgets and
# rendercanvas arrive transitively (via anywidget and pygfx respectively); the
# notebook host applications (jupyter, marimo) are not declared here -- the user
# installs whichever host they run in.
anywidget = ["anywidget", "simplejpeg", "sidecar"]
# spatial graph support: geff file reading and the "roi" slice strategy.
# Both are lazily imported; the default "mask" slice path needs neither.
graph = ["geff", "spatial-graph"]
test = [
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-qt",
# so CI exercises the geff loader and the "roi" slice strategy; without
# it those tests would silently skip and only "mask" would ever run.
"cellier[graph]",
]
# add anything else you like to have in your dev environment here
dev = [
"ipython",
"marimo",
"pdbpp", # https://github.com/pdbpp/pdbpp
"pre-commit",
"rich", # https://github.com/Textualize/rich
"ruff",
"zensical>=0.0.40",
"mkdocstrings-python",
"griffe-pydantic>=1.3.1",
]
# optional rich-powered debug logging
logging = ["rich>=13.0"]
# dependencies for the example scripts
examples = ["scikit-image", "pyvista"]
# get all dependencies for development
dev-all = ["cellier[dev,test,pyside,examples,logging,remote,anywidget]"]
[project.urls]
homepage = "https://github.com/kevinyamauchi/cellier"
repository = "https://github.com/kevinyamauchi/cellier"
# Entry points
# https://peps.python.org/pep-0621/#entry-points
# same as console_scripts entry point
# [project.scripts]
# cellier-cli = "cellier:main_cli"
# [project.entry-points."some.group"]
# tomatoes = "cellier:main_tomatoes"
# https://docs.astral.sh/ruff
[tool.ruff]
line-length = 88
target-version = "py38"
src = ["src"]
# 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
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
]
ignore = [
"D401", # First line should be in imperative mood (remove to opt in)
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S"]
"scripts/**/*.py" = ["D", "E402", "E501", "E702", "F841", "F821", "TCH", "RUF001", "RUF002", "RUF003", "RUF006", "B007", "C416"]
# Pydantic v2 models require these imports at runtime for field type resolution
"src/cellier/scene/*.py" = ["TCH001", "TCH003"]
"src/cellier/viewer_model.py" = ["TCH001", "TCH003"]
"src/cellier/visuals/_base_visual.py" = ["TCH001", "TCH003"]
"src/cellier/data/graph/*.py" = ["TCH001", "TCH003"]
# docstring-code-format collapses wrapped examples; E501 fires on indent+content
"src/cellier/gui/**/*.py" = ["E501"]
# https://docs.astral.sh/ruff/formatter/
[tool.ruff.format]
docstring-code-format = true
skip-magic-trailing-comma = false # default is false
# https://docs.pytest.org/
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
filterwarnings = [
"error",
"ignore:'asyncio.AbstractEventLoopPolicy':DeprecationWarning",
# spatial_graph -> witty -> Cheetah -> `import cgi`. Cheetah guards that
# import with `except ImportError` for Python 3.13, where cgi was removed,
# but on 3.11/3.12 cgi still exists and only warns -- and a try/except
# cannot catch a warning. Fires once per process, on whichever test first
# builds a SpatialGraph, so it cannot be pinned to one test module.
# Drop this when Cheetah stops importing cgi, or when 3.11 and 3.12 leave
# the CI matrix.
"ignore:'cgi' is deprecated:DeprecationWarning",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
# 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 = ["cellier"]
# https://github.com/mgedmin/check-manifest#configuration
# add files that you want check-manifest to explicitly ignore here
# (files that are in the repo but shouldn't go in the package)
[tool.check-manifest]
ignore = [
".pre-commit-config.yaml",
".ruff_cache/**/*",
"tests/**/*",
]
[tool.typos.default.extend-words]
# LOD = Level Of Detail — not a typo for "load"
lod = "lod"
# ser = serialization abbreviation (pydantic_core API uses _ser_schema suffixes)
ser = "ser"
# nd = number of dimensions abbreviation (used as local variable)
nd = "nd"
dims = "dims"