File: pyproject.toml

package info (click to toggle)
zarr 3.1.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,068 kB
  • sloc: python: 31,589; makefile: 10
file content (454 lines) | stat: -rw-r--r-- 12,196 bytes parent folder | download
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
[build-system]
requires = ["hatchling>=1.27.0", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.sdist]
exclude = [
  "/.github",
  "/bench",
  "/docs",
]

[project]
name = "zarr"
description = "An implementation of chunked, compressed, N-dimensional arrays for Python"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
    { name = "Alistair Miles", email = "alimanfoo@googlemail.com" },
]
maintainers = [
    { name = "Davis Bennett", email = "davis.v.bennett@gmail.com" },
    { name = "jakirkham" },
    { name = "Josh Moore", email = "josh@openmicroscopy.org" },
    { name = "Joe Hamman", email = "joe@earthmover.io" },
    { name = "Juan Nunez-Iglesias", email = "juan.nunez-iglesias@monash.edu" },
    { name = "Martin Durant", email = "mdurant@anaconda.com" },
    { name = "Norman Rzepka" },
    { name = "Ryan Abernathey" },
    { name = "David Stansby" },
    { name = "Tom Augspurger", email = "tom.w.augspurger@gmail.com" },
    { name = "Deepak Cherian" }
]
requires-python = ">=3.11"
# If you add a new dependency here, please also add it to .pre-commit-config.yml
dependencies = [
    'packaging>=22.0',
    'numpy>=1.26',
    'numcodecs>=0.14',
    'google-crc32c>=1.5',
    'typing_extensions>=4.9',
    'donfig>=0.8',
]

dynamic = [
  "version",
]
classifiers = [
    'Development Status :: 6 - Mature',
    'Intended Audience :: Developers',
    'Intended Audience :: Information Technology',
    'Intended Audience :: Science/Research',
    'Programming Language :: Python',
    'Topic :: Software Development :: Libraries :: Python Modules',
    'Operating System :: Unix',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.11',
    'Programming Language :: Python :: 3.12',
    'Programming Language :: Python :: 3.13',
]
license = "MIT"
license-files = ["LICENSE.txt"]
keywords = ["Python", "compressed", "ndimensional-arrays", "zarr"]

[project.optional-dependencies]
# User extras
remote = [
    "fsspec>=2023.10.0",
    "obstore>=0.5.1",
]
gpu = [
    "cupy-cuda12x",
]
cli = ["typer"]
# Development extras
test = [
    "coverage>=7.10",
    # Pin possibly due to https://github.com/pytest-dev/pytest-cov/issues/693
    "pytest<8.4",
    "pytest-asyncio",
    "pytest-cov",
    "pytest-accept",
    "rich",
    "mypy",
    'numpydoc',
    "hypothesis",
    "pytest-xdist",
    "packaging",
    "tomlkit",
    "uv",
]
remote_tests = [
    'zarr[remote]',
    "botocore",
    "s3fs>=2023.10.0",
    "moto[s3,server]",
    "requests",
]
optional = ["rich", "universal-pathlib"]
docs = [
    # Doc building
    "mkdocs-material[imaging]>=9.6.14",
    "mkdocs>=1.6.1",
    "mkdocstrings>=0.29.1",
    "mkdocstrings-python>=1.16.10",
    "mike>=2.1.3",
    "mkdocs-redirects>=1.2.0",
    "markdown-exec[ansi]",
    "griffe-inherited-docstrings",
    "ruff",
    # Changelog generation
    'towncrier',
    # Optional dependencies to run examples
    'numcodecs[msgpack]',
    'rich',
    's3fs>=2023.10.0',
    'astroid<4',
    'pytest'
]

[project.scripts]
zarr = "zarr._cli.cli:app"


[project.urls]
issues = "https://github.com/zarr-developers/zarr-python/issues"
changelog = "https://zarr.readthedocs.io/en/stable/release-notes.html"
Discussions = "https://github.com/zarr-developers/zarr-python/discussions"
documentation = "https://zarr.readthedocs.io/"
homepage = "https://github.com/zarr-developers/zarr-python"

[dependency-groups]
dev = [
    "ipykernel>=6.29.5",
    "pip>=25.0.1",
]

[tool.coverage.report]
exclude_also = [
    'if TYPE_CHECKING:',
]

[tool.coverage.run]
omit = [
    "bench/compress_normal.py",
    "src/zarr/testing/conftest.py",  # only for downstream projects
]

[tool.hatch]
version.source = "vcs"

[tool.hatch.build]
hooks.vcs.version-file = "src/zarr/_version.py"

[tool.hatch.envs.test]
dependencies = [
    "numpy~={matrix:numpy}",
]
features = ["test"]

[tool.hatch.envs.test.env-vars]
# Required to test with a pytest plugin; see https://pytest-cov.readthedocs.io/en/latest/plugins.html
COV_CORE_SOURCE = "src"
COV_CORE_CONFIG = ".coveragerc"
COV_CORE_DATAFILE = ".coverage.eager"

[[tool.hatch.envs.test.matrix]]
python = ["3.11", "3.12", "3.13"]
numpy = ["1.26", "2.2"]
deps = ["minimal", "optional"]

[tool.hatch.envs.test.overrides]
matrix.deps.dependencies = [
  {value = "zarr[remote, remote_tests, test, optional, cli]", if = ["optional"]}
]

[tool.hatch.envs.test.scripts]
run-coverage = "pytest --cov-config=pyproject.toml --cov=src --cov-append --cov-report xml --junitxml=junit.xml -o junit_family=legacy"
run-coverage-html = "pytest --cov-config=pyproject.toml --cov=src --cov-append --cov-report html"
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=src --cov-append --cov-report xml --junitxml=junit.xml -o junit_family=legacy"
run = "run-coverage --no-cov"
run-pytest = "run"
run-verbose = "run-coverage --verbose"
run-mypy = "mypy src"
run-hypothesis = "run-coverage -nauto --run-slow-hypothesis tests/test_properties.py tests/test_store/test_stateful*"
list-env = "pip list"

[tool.hatch.envs.gputest]
template = "test"
dependencies = [
    "numpy~={matrix:numpy}",
    "universal_pathlib",
]
features = ["test", "gpu"]

[[tool.hatch.envs.gputest.matrix]]
python = ["3.11", "3.12", "3.13"]
numpy = ["1.26", "2.2"]
version = ["minimal"]

[tool.hatch.envs.gputest.scripts]
run-coverage = "pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run = "run-coverage --no-cov"
run-verbose = "run-coverage --verbose"
run-mypy = "mypy src"
run-hypothesis = "run-coverage --hypothesis-profile ci --run-slow-hypothesis tests/test_properties.py tests/test_store/test_stateful*"
list-env = "pip list"

[tool.hatch.envs.upstream]
template = 'test'
python = "3.13"
dependencies = [
    'packaging @ git+https://github.com/pypa/packaging',
    'numpy',  # from scientific-python-nightly-wheels
    'numcodecs @ git+https://github.com/zarr-developers/numcodecs',
    's3fs @ git+https://github.com/fsspec/s3fs',
    'universal_pathlib @ git+https://github.com/fsspec/universal_pathlib',
    'typing_extensions @ git+https://github.com/python/typing_extensions',
    'donfig @ git+https://github.com/pytroll/donfig',
    'obstore @ git+https://github.com/developmentseed/obstore@main#subdirectory=obstore',
    # test deps
    'zarr[test]',
]

[tool.hatch.envs.upstream.env-vars]
PIP_INDEX_URL = "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/"
PIP_EXTRA_INDEX_URL = "https://pypi.org/simple/"
PIP_PRE = "1"

[tool.hatch.envs.min_deps]
description = """Test environment for minimum supported dependencies

See Spec 0000 for details and drop schedule: https://scientific-python.org/specs/spec-0000/
"""
template = "test"
python = "3.11"
dependencies = [
    'zarr[remote]',
    'packaging==22.*',
    'numpy==1.26.*',
    'numcodecs==0.14.*',  # 0.14 needed for zarr3 codecs
    'fsspec==2023.10.0',
    's3fs==2023.10.0',
    'universal_pathlib==0.0.22',
    'typing_extensions==4.9.*',
    'donfig==0.8.*',
    'obstore==0.5.*',
    # test deps
    'zarr[test]',
    'zarr[remote_tests]',
]

[tool.hatch.envs.docs]
features = ['docs', 'remote']

[tool.hatch.envs.docs.scripts]
serve = "mkdocs serve --watch src"
build = "mkdocs build"
check = "mkdocs build --strict"
readthedocs = "rm -rf $READTHEDOCS_OUTPUT/html && cp -r site $READTHEDOCS_OUTPUT/html"

[tool.hatch.envs.doctest]
description = "Test environment for validating executable code blocks in documentation"
features = ['test', 'remote']  # Include remote dependencies for s3fs
dependencies = [
    "s3fs>=2023.10.0",
    "pytest",
    "pytest-examples",
]

[tool.hatch.envs.doctest.scripts]
test = "pytest tests/test_docs.py -v"
list-env = "pip list"

[tool.ruff]
line-length = 100
force-exclude = true
extend-exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".ruff_cache",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "venv",
    "docs",
    "tests/test_regression/scripts/", # these are scripts that use a different version of python
    "src/zarr/v2/",
    "tests/v2/",
]

[tool.ruff.lint]
extend-select = [
    "ANN",  # flake8-annotations
    "B",    # flake8-bugbear
    "C4",   # flake8-comprehensions
    "EXE",  # flake8-executable
    "FA",   # flake8-future-annotations
    "FLY",  # flynt
    "FURB", # refurb
    "G",    # flake8-logging-format
    "I",    # isort
    "ISC",  # flake8-implicit-str-concat
    "LOG",  # flake8-logging
    "PERF", # Perflint
    "PIE",  # flake8-pie
    "PGH",  # pygrep-hooks
    "PT",   # flake8-pytest-style
    "PYI",  # flake8-pyi
    "RET",  # flake8-return
    "RSE",  # flake8-raise
    "RUF",
    "SIM",  # flake8-simplify
    "SLOT", # flake8-slots
    "TC",  # flake8-type-checking
    "TRY",  # tryceratops
    "UP",   # pyupgrade
    "W",    # pycodestyle warnings
]
ignore = [
    "ANN401",
    "PT011",  # TODO: apply this rule
    "RET505",
    "RET506",
    "RUF005",
    "RUF043",
    "SIM108",
    "TRY003",
    # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
    "W191",
    "E111",
    "E114",
    "E117",
    "D206",
    "D300",
    "Q000",
    "Q001",
    "Q002",
    "Q003",
    "COM812",
    "COM819",
    "TC006",
]

[tool.ruff.lint.extend-per-file-ignores]
"tests/**" = ["ANN001", "ANN201", "RUF029", "SIM117", "SIM300"]

[tool.mypy]
python_version = "3.11"
ignore_missing_imports = true
namespace_packages = false

strict = true
warn_unreachable = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]

[[tool.mypy.overrides]]
module = [
    "tests.package_with_entrypoint.*",
    "zarr.testing.stateful",
    "tests.test_codecs.test_transpose",
    "tests.test_config",
    "tests.test_store.test_zip",
    "tests.test_store.test_local",
    "tests.test_store.test_fsspec",
    "tests.test_store.test_memory",
    "tests.test_codecs.test_codecs",
    "tests.test_metadata.*",
    "tests.test_store.test_core",
    "tests.test_store.test_logging",
    "tests.test_store.test_object",
    "tests.test_store.test_stateful",
    "tests.test_store.test_wrapper",
]
strict = false

# TODO: Move the next modules up to the strict = false section
# and fix the errors
[[tool.mypy.overrides]]
module = [
    "tests.test_group",
    "tests.test_indexing",
    "tests.test_properties",
    "tests.test_sync",
    "tests.test_regression.scripts.*"
]
ignore_errors = true

[tool.pytest.ini_options]
minversion = "7"
testpaths = ["tests", "docs/user-guide"]
log_cli_level = "INFO"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
doctest_optionflags = [
    "NORMALIZE_WHITESPACE",
    "ELLIPSIS",
    "IGNORE_EXCEPTION_DETAIL",
]
addopts = [
    "--durations=10", "-ra", "--strict-config", "--strict-markers",
]
filterwarnings = [
    "error",
    "ignore:Unclosed client session <aiohttp.client.ClientSession.*:ResourceWarning",
    "ignore:Numcodecs codecs are not in the Zarr version 3 specification.*:UserWarning"
]
markers = [
    "asyncio: mark test as asyncio test",
    "gpu: mark a test as requiring CuPy and GPU",
    "slow_hypothesis: slow hypothesis tests",
]

[tool.repo-review]
ignore = [
	"PC111",  # fix Python code in documentation - enable later
	"PC180",  # for JavaScript - not interested
]

[tool.numpydoc_validation]
# See https://numpydoc.readthedocs.io/en/latest/validation.html#built-in-validation-checks for list of checks
checks = [
    # Requires third-party support; see https://github.com/numpy/numpydoc/issues/463
    # "GL06",
    # "GL07",
    # Currently broken; see https://github.com/numpy/numpydoc/issues/573
    # "GL09",
    "GL10",
    "SS04",
    "PR02",
    "PR03",
    "PR05",
    "PR06",
]

[tool.towncrier]
directory = 'changes'
filename = "docs/release-notes.md"
underlines = ["", "", ""]
issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/issues{issue})"
start_string = "<!-- towncrier release notes start -->\n"

[tool.codespell]
ignore-words-list = "astroid"

[project.entry-points.pytest11]
zarr = "zarr.testing"