forked from zarr-developers/VirtualiZarr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
301 lines (266 loc) · 9.31 KB
/
Copy pathpyproject.toml
File metadata and controls
301 lines (266 loc) · 9.31 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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
[project]
name = "virtualizarr"
description = "Create virtual Zarr stores from archival data using xarray API"
readme = "README.md"
authors = [
{name = "Thomas Nicholas", email = "tom@cworthy.org"}
]
license = {text = "Apache-2"}
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.11"
dynamic = ["version"]
dependencies = [
"xarray>=2025.3.0",
"numpy>=2.0.0",
"universal-pathlib",
"numcodecs>=0.15.1",
"ujson",
"packaging",
"zarr>=3.0.2",
]
# Dependency sets under optional-dependencies are available via PyPI
[project.optional-dependencies]
# for creating virtual datasets from objects on remote storage
remote = [
"fsspec",
"requests",
"aiohttp",
"s3fs",
]
obstore = [
"obstore>=0.5.1",
]
# non-kerchunk-based readers
hdf = [
"virtualizarr[remote]",
"h5py",
"hdf5plugin",
"imagecodecs",
"imagecodecs-numcodecs==2024.6.1",
]
# kerchunk-based readers
hdf5 = [
"virtualizarr[remote]",
"kerchunk>=0.2.8",
"h5py",
]
netcdf3 = [
"virtualizarr[remote]",
"kerchunk>=0.2.8",
"scipy",
]
fits = [
"virtualizarr[remote]",
"kerchunk>=0.2.8",
"astropy",
]
all_readers = [
"virtualizarr[hdf]",
"virtualizarr[hdf5]",
"virtualizarr[netcdf3]",
"virtualizarr[fits]",
]
# writers
icechunk = [
"icechunk>=0.2.4",
]
kerchunk = ["fastparquet"]
all_writers = [
"virtualizarr[icechunk]",
"virtualizarr[kerchunk]",
]
# Dependency sets under dependencies-groups are NOT available via PyPI
[dependency-groups]
upstream = [
'xarray @ git+https://github.com/pydata/xarray',
'universal_pathlib @ git+https://github.com/fsspec/universal_pathlib',
'numcodecs @ git+https://github.com/zarr-developers/numcodecs',
'ujson @ git+https://github.com/ultrajson/ultrajson',
'zarr @ git+https://github.com/zarr-developers/zarr-python',
# optional dependencies
'astropy @ git+https://github.com/astropy/astropy',
'fsspec @ git+https://github.com/fsspec/filesystem_spec',
's3fs @ git+https://github.com/fsspec/s3fs',
'kerchunk @ git+https://github.com/fsspec/kerchunk',
'icechunk @ git+https://github.com/earth-mover/icechunk#subdirectory=icechunk-python',
]
docs = [
"sphinx",
"myst_nb",
"pydata_sphinx_theme",
"sphinx_copybutton",
"sphinx_design",
"sphinx_togglebutton",
"sphinx-autobuild>=2021.3.14",
"sphinx-autodoc-typehints",
]
dev = [
"codecov",
"mypy",
"pandas-stubs",
"pooch",
"pre-commit",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mypy",
"pytest-xdist",
"ruff",
"s3fs",
"lithops",
"dask",
]
[project.urls]
Home = "https://github.com/zarr-developers/VirtualiZarr"
Documentation = "https://github.com/zarr-developers/VirtualiZarr/blob/main/README.md"
[build-system]
requires = [
"setuptools>=61.0.0",
"wheel",
"setuptools_scm[toml]>=7.0",
"check-manifest",
]
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
# Add the editable project pip install to the default group
[tool.pixi.pypi-dependencies]
virtualizarr = { path = ".", editable = true }
# Define a feature set for Python 3.11
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
# Define a feature set for Python 3.12
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
# Define a feature set for S3 testing with MinIO
[tool.pixi.feature.minio.pypi-dependencies]
"docker" = "*"
"minio" = "*"
# Install NetCDF and HDF5 from conda-forge for extra plugin capabilities
[tool.pixi.feature.hdf5-lib.dependencies]
netcdf4 = ">=1.7.2,<2"
hdf5 = ">=1.14.4,<2"
h5netcdf = ">=1.5.0,<2"
[tool.pixi.feature.icechunk-dev.dependencies]
rust = "*"
# Define commands to run within the test environments
[tool.pixi.feature.test.tasks]
run-mypy = { cmd = "mypy virtualizarr" }
# Using '--dist loadscope' (rather than default of '--dist load' when '-n auto'
# is used), reduces test hangs that appear to be macOS-related.
run-tests = { cmd = "pytest -n auto --dist loadscope --run-network-tests --verbose" }
run-tests-no-network = { cmd = "pytest -n auto --verbose" }
run-tests-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov=term-missing" }
run-tests-xml-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov-report=xml" }
run-tests-html-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov-report=html" }
# Define which features and groups to include in different pixi (similar to conda) environments)
[tool.pixi.environments]
min-deps = ["dev", "test", "hdf", "hdf5", "hdf5-lib"] # VirtualiZarr/conftest.py using h5py, so the minimum set of dependencies for testing still includes hdf libs
# Inherit from min-deps to get all the test commands, along with optional dependencies
test = ["dev", "test", "remote", "hdf", "hdf5", "netcdf3", "fits", "icechunk", "kerchunk", "hdf5-lib", "obstore"]
test-py311 = ["dev", "test", "remote", "hdf", "hdf5", "netcdf3", "fits", "icechunk", "kerchunk", "hdf5-lib", "obstore", "py311"] # test against python 3.11
test-py312 = ["dev", "test", "remote", "hdf", "hdf5", "netcdf3", "fits", "icechunk", "kerchunk", "hdf5-lib", "obstore", "py312"] # test against python 3.12
minio = ["dev", "remote", "hdf", "hdf5", "netcdf3", "fits", "icechunk", "kerchunk", "hdf5-lib", "obstore", "py312", "minio"]
upstream = ["dev", "test", "hdf", "hdf5", "hdf5-lib", "netcdf3", "upstream", "icechunk-dev"]
all = ["dev", "test", "remote", "hdf", "hdf5", "netcdf3", "fits", "icechunk", "kerchunk", "hdf5-lib", "obstore", "all_readers", "all_writers"]
docs = ["docs"]
# Define commands to run within the docs environment
[tool.pixi.feature.docs.tasks]
build-docs = { cmd = "make html", cwd = "docs" }
serve-docs = { cmd = "sphinx-autobuild docs docs/_build --host 0.0.0.0" }
readthedocs = "rm -rf $READTHEDOCS_OUTPUT/html && cp -r docs/_build/html $READTHEDOCS_OUTPUT/html"
# Define commands to run within the docs environment
[tool.pixi.feature.minio.tasks]
run-tests = { cmd = "pytest virtualizarr/tests/test_manifests/test_store.py --run-minio-tests --verbose" }
run-tests-xml-cov = { cmd = "pytest virtualizarr/tests/test_manifests/test_store.py --run-minio-tests --verbose --cov-report=xml" }
[tool.setuptools_scm]
fallback_version = "9999"
[tool.setuptools.packages.find]
exclude = ["docs", "tests", "tests.*", "docs.*"]
[tool.setuptools.package-data]
datatree = ["py.typed"]
[tool.mypy]
files = "virtualizarr/**/*.py"
show_error_codes = true
[[tool.mypy.overrides]]
module = [
"docker",
"fsspec.*",
"h5py",
"kerchunk.*",
"minio",
"numcodecs.*",
"ujson",
"zarr",
]
ignore_missing_imports = true
[tool.ruff]
# Same as Black.
line-length = 88
indent-width = 4
target-version = "py310"
exclude = [
"docs",
".eggs"
]
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "I"]
per-file-ignores = {}
# E402: module level import not at top of file
# E731: do not assign a lambda expression, use a def
# W503: line break before binary operator - not implimeted by ruff due to conflict with PEP8.
ignore = ["E402", "E731"]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Indent with spaces, rather than tabs.
indent-style = "space"
# Respect magic trailing commas.
skip-magic-trailing-comma = false
# Automatically detect the appropriate line ending.
line-ending = "auto"
[tool.ruff.lint.isort]
known-first-party = ["virtualizarr"]
[tool.coverage.run]
include = ["virtualizarr/"]
omit = ["conftest.py", "virtualizarr/tests/*"]
[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:",
]
[tool.pytest.ini_options]
# See https://pytest-asyncio.readthedocs.io/en/latest/concepts.html#asyncio-event-loops
# Explicitly set asyncio_default_fixture_loop_scope to eliminate the following warning:
#
# PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope"
# is unset. The event loop scope for asynchronous fixtures will default to the fixture
# caching scope. Future versions of pytest-asyncio will default the loop scope for
# asynchronous fixtures to function scope. Set the default fixture loop scope
# explicitly in order to avoid unexpected behavior in the future. Valid fixture loop
# scopes are: "function", "class", "module", "package", "session"
#
asyncio_default_fixture_loop_scope = "session"
markers = [
# Although we may not use pytest.mark.flaky, some of our test modules import
# from xarray.tests, and xarray.tests.__init__.py references pytest.mark.flaky.
# Therefore, without the "flaky" marker below, during test execution, we see
# this warning: "PytestUnknownMarkWarning: Unknown pytest.mark.flaky"
"flaky: flaky tests",
"network: marks test requiring internet (select with '--run-network-tests')",
"minio: marks test requiring docker and minio (select with '--run-minio-tests')",
]