-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpyproject.toml
More file actions
245 lines (222 loc) · 7.57 KB
/
Copy pathpyproject.toml
File metadata and controls
245 lines (222 loc) · 7.57 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
# https://peps.python.org/pep-0517/
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
# 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 = "microsim"
dynamic = ["version"]
description = "Light microscopy simulation in python"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "BSD-3-Clause" }
authors = [{ name = "Talley Lambert", email = "talley.lambert@gmail.com" }]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Typing :: Typed",
]
dependencies = [
"annotated-types >=0.7.0",
# min pins per-python reflect the first release shipping a wheel
"numpy >=2.3.2; python_version >= '3.14'",
"numpy >=2.1.0; python_version >= '3.13'",
"numpy >=2.0",
"pint >=0.24.4",
"platformdirs >=4.3.6",
# pydantic 2.12.0/.1 mis-build some models under py3.14 (deferred annotations).
"pydantic >=2.12.2; python_version >= '3.14'",
"pydantic >=2.8",
"fpbase >=0.1.2",
"pydantic-settings >2.5.0",
"scipy >=1.16.1; python_version >= '3.14'",
"scipy >=1.15.2",
# tensorstore >=0.1.77 crashes at interpreter shutdown on Windows when the
# S3/HTTP transport has been used (google/tensorstore#275). Pin below it on
# Windows where a clean wheel exists (no cp314 wheel before 0.1.79, so
# py3.14 can't be pinned and is unaffected by this cap).
"tensorstore <0.1.77; sys_platform == 'win32' and python_version < '3.14'",
"tensorstore >=0.1.79; python_version >= '3.14'",
"tensorstore >=0.1.76",
"tqdm >=4.67.1",
"xarray >=2025.7.0; python_version >= '3.14'",
"xarray >=2025.1.1",
"zarr >=3",
]
[project.urls]
homepage = "https://github.com/tlambert03/microsim"
repository = "https://github.com/tlambert03/microsim"
# # https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
view = [
"ndv[pyqt,vispy]",
# matplotlib <3.10.7 calls pyparsing's deprecated `oneOf` (warns with
# pyparsing >=3.3).
"matplotlib>=3.10.7",
# optional OpenGL speedup; no cp314 wheel and fails to build from source
"pyopengl-accelerate>=3.1.9; python_version < '3.14'",
]
io = ["tifffile>=2025.2.18", "imageio[ffmpeg]>=2.22"]
cosem = [
"imageio>=2.22",
"boto3>=1.32",
# supabase <2.17 bundles the deprecated `gotrue` (warns at import; renamed
# to supabase_auth in 2.17).
"supabase>=2.17.0",
"s3fs>=0.4.2",
]
torch = [
# torch/torchaudio only ship cp314 wheels from 2.9.0.
"torch>=2.9.0; python_version >= '3.14'",
"torchaudio>=2.9.0; python_version >= '3.14'",
"torch>=2.6.0",
"torchaudio>=2.7.0",
]
# jaxlib only ships cp314 wheels from 0.7.1 (jax/jaxlib versions are coupled).
jax = ["jax[cpu]>=0.7.1; python_version >= '3.14'", "jax[cpu]>=0.5.2"]
all = ["microsim[view,io,cosem]", "rich>=13"]
[dependency-groups]
test = ["pytest>=8.3.5", "pytest-cov>=6.0.0"]
dev = [
{ include-group = "test" },
"microsim[all,jax,torch]",
"pdbpp; sys_platform == 'darwin'",
"prek>=0.4.5",
"rich>=15.0.0",
"ruff>=0.15.18",
"types-tqdm>=4.68.0.20260608",
"mypy>=2.1.0",
"ipython>=9.14.1",
"boto3-stubs[s3]>=1.43.34",
]
docs = [
"mkdocs >=1.5.3",
"mkdocs-material==9.5.17",
"mkdocs-autorefs==1.1.0",
"mkdocstrings ==0.24.3",
"mkdocstrings-python ==1.9.2",
"mkdocs-jupyter==0.24.8",
"griffe==0.45.3",
"griffe-fieldz==0.1.2", # 0.5.0 needs a newer griffe than the pin above
]
[tool.uv]
# pillow (transitive via matplotlib/imageio) only ships cp314 wheels from 11.3.0
constraint-dependencies = ["pillow>=11.3.0; python_version >= '3.14'"]
[tool.uv.sources]
microsim = { workspace = true }
[tool.ruff]
line-length = 88
target-version = "py312"
src = ["src"]
fix = true
unsafe-fixes = true
[tool.ruff.lint]
pydocstyle = { convention = "numpy" }
pyupgrade = { keep-runtime-typing = true }
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 = [
"D10", # Missing docstring in public ...
"D401", # First line should be in imperative mood
]
exclude = ["*xarray_jax*"]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S"]
"setup.py" = ["D"]
"docs/*.py" = ["E402"]
# 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"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = false
# [[tool.mypy.overrides]]
# module = ["numpy.*",]
# ignore_errors = true
[[tool.mypy.overrides]]
module = ["microsim.xarray_jax.*"]
ignore_errors = true
[tool.pyright]
reportArgumentType = false # too hard with pydantic
# https://docs.pytest.org/en/6.2.x/customize.html
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
filterwarnings = [
"error",
"ignore:unclosed transport:ResourceWarning", # only on py3.10... not sure why
"ignore:Clipping negative intensity values:UserWarning", # when importing FPbase spectra
"ignore:__array__ implementation doesn't accept a copy keyword",
# xarray triggers this numpy>=2.4 deprecation at import time (xarray/core/dtypes.py)
"ignore:The 'generic' unit for NumPy timedelta is deprecated:DeprecationWarning",
# py3.14's GC surfaces unclosed sockets/responses from third-party network
# clients (supabase/s3fs/urllib) as fatal unraisable ResourceWarnings.
"ignore::ResourceWarning",
"ignore::pytest.PytestUnraisableExceptionWarning",
# supabase>=2.31 passes now-deprecated params (timeout/verify/proxy) to postgrest
"ignore:The '.*' parameter is deprecated:DeprecationWarning",
# zarr v3 (esp. 3.0.x) warns that the string-coord dtype / vlen-utf8 codec
# used for channel names isn't in the v3 spec yet; intentional and benign.
"ignore:The data type .* does not have a Zarr V3 specification:FutureWarning",
"ignore:The \\w+ .* is currently not part in the Zarr format 3 specification:UserWarning",
# numcodecs >=0.16.4 (pulled in with older zarr 3.x) deprecates its bundled
# crc32c at import time; harmless and outside our control.
"ignore:crc32c usage is deprecated:DeprecationWarning",
]
# https://coverage.readthedocs.io/en/6.4/config.html
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"except ImportError",
"raise ValueError",
"\\.\\.\\.",
"raise NotImplementedError()",
"pass",
]
[tool.coverage.run]
source = ["microsim"]
omit = ["*xarray_jax*"]
# 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 = [
".github_changelog_generator",
".pre-commit-config.yaml",
".ruff_cache/**/*",
"setup.py",
"tests/**/*",
]
[tool.typos.default]
extend-ignore-identifiers-re = ["(?i)nd.*", "(?i)ome", "(?i)ser"]