-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
178 lines (168 loc) · 6.08 KB
/
pyproject.toml
File metadata and controls
178 lines (168 loc) · 6.08 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
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-docstring-description>=1.1.1",
"hatch-fancy-pypi-readme",
"hatch-vcs",
"hatchling",
]
[project]
name = "fast-array-utils"
license = "MPL-2.0"
authors = [
{ name = "Philipp A.", email = "flying-sheep@web.de" },
]
requires-python = ">=3.12"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = [ "version" ]
dependencies = [ "array-api-compat", "numpy>=2" ]
optional-dependencies.accel = [ "numba>=0.57" ]
optional-dependencies.dask = [ "dask>=2023.6.1" ]
optional-dependencies.full = [ "fast-array-utils[accel,dask,sparse]", "h5py", "zarr" ]
optional-dependencies.sparse = [ "scipy>=1.13" ]
optional-dependencies.testing = [ "packaging" ]
urls."Issue Tracker" = "https://github.com/scverse/fast-array-utils/issues"
urls."Source Code" = "https://github.com/scverse/fast-array-utils"
urls.Documentation = "https://icb-fast-array-utils.readthedocs-hosted.com/"
entry-points.pytest11.fast_array_utils = "testing.fast_array_utils.pytest"
[dependency-groups]
test = [
"anndata",
"fast-array-utils[full]",
"jax",
"jaxlib",
"scikit-learn",
{ include-group = "test-min" },
]
doc = [
"furo>=2024.8.6",
"pytest>=8.4",
"sphinx>=9.0.1",
"sphinx-autofixture>=0.4.1",
]
test-min = [
"coverage[toml]",
"fast-array-utils[sparse,testing]", # include sparse for testing numba-less to_dense
"pytest",
"pytest-codspeed",
"pytest-doctestplus",
"pytest-xdist",
]
[tool.hatch]
build.targets.wheel.packages = [ "src/testing", "src/fast_array_utils" ]
envs.default.installer = "uv"
envs.docs.dependency-groups = [ "doc" ]
envs.docs.scripts.build = "sphinx-build -M html docs docs/_build"
envs.docs.scripts.clean = "git clean -fdX docs"
envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
envs.hatch-test.default-args = []
envs.hatch-test.dependency-groups = [ "test-min" ]
envs.hatch-test.extra-dependencies = [ "ipykernel", "ipycytoscape" ]
envs.hatch-test.env-vars.CODSPEED_PROFILE_FOLDER = "test-data/codspeed"
envs.hatch-test.overrides.matrix.extras.dependency-groups = [
{ if = [ "full" ], value = "test" },
]
envs.hatch-test.overrides.matrix.resolution.dependencies = [
# TODO: move to `min-reqs` feature once this is fixed: https://github.com/tlambert03/hatch-min-requirements/issues/11
{ if = [ "lowest" ], value = "numpy==2" },
{ if = [ "lowest" ], value = "dask==2023.6.1" },
{ if = [ "lowest" ], value = "scipy==1.13.0" },
]
envs.hatch-test.matrix = [
{ python = [ "3.14", "3.12" ], extras = [ "full", "min" ] },
{ python = [ "3.12" ], extras = [ "full" ], resolution = [ "lowest" ] },
]
# TODO: re-activate incl. `dynamic = [ "description", "readme", ... ]` after https://github.com/pypa/hatch/issues/2252
# metadata.hooks.docstring-description = {}
# metadata.hooks.fancy-pypi-readme.content-type = "text/x-rst"
# metadata.hooks.fancy-pypi-readme.fragments = [ { path = "README.rst", start-after = ".. begin" } ]
version.source = "vcs"
version.raw-options = { local_scheme = "no-local-version" } # be able to publish dev version
[tool.uv]
override-dependencies = [ "sphinx>=9.0.1" ]
[tool.ruff]
line-length = 160
namespace-packages = [ "src/testing" ]
format.preview = true
format.docstring-code-format = true
lint.select = [ "ALL" ]
lint.ignore = [
"A005", # submodules never shadow builtins.
"C408", # dict() calls are nice
"COM812", # trailing commas handled by black
"D203", # prefer 0 to 1 blank line before class members
"D213", # prefer docstring summary on first line
"FIX002", # “TODO” comments
"N812", # lowercase imports are fine
"PLC0415", # we rely heavily on non-top-level imports
"PLR0913", # having many (kw)args is fine
"Q", # handled by formatter
"S101", # asserts are fine
"TID252", # relative imports are fine
]
# No __init__.py in docs
lint.per-file-ignores."docs/**/*.py" = [ "INP001" ]
# Shadows builtins like `sum`
lint.per-file-ignores."src/**/stats/*.py" = [ "A001", "A004" ]
lint.per-file-ignores."tests/**/*.py" = [
"D100", # tests need no module docstrings
"D103", # tests need no function docstrings
"INP001", # tests should not have __init__.py
"PLR2004", # tests use magic values
"S101", # tests use `assert`
]
# Stubs don’t follow name conventions
lint.per-file-ignores."typings/**/*.pyi" = [ "A002", "F403", "F405", "N801" ]
lint.allowed-confusables = [ "×", "’" ]
lint.flake8-bugbear.extend-immutable-calls = [ "testing.fast_array_utils.Flags" ]
lint.flake8-copyright.notice-rgx = "SPDX-License-Identifier: MPL-2\\.0"
lint.flake8-type-checking.exempt-modules = []
lint.flake8-type-checking.strict = true
lint.isort.known-first-party = [ "fast_array_utils" ]
lint.isort.lines-after-imports = 2
lint.pydocstyle.convention = "numpy"
lint.future-annotations = true
[tool.mypy]
strict = true
# https://github.com/dask/dask/issues/8853
implicit_reexport = true
explicit_package_bases = true
mypy_path = [ "$MYPY_CONFIG_FILE_DIR/typings", "$MYPY_CONFIG_FILE_DIR/src" ]
[tool.pyright]
stubPath = "./typings"
reportPrivateUsage = false
[tool.ty]
environment.extra-paths = [ "./typings" ]
[tool.pytest]
strict = true
addopts = [
"--import-mode=importlib",
"--doctest-modules",
"--doctest-plus",
"--pyargs",
]
testpaths = [ "./tests", "fast_array_utils" ]
doctest_subpackage_requires = [
"src/fast_array_utils/conv/scipy/* = scipy",
"src/fast_array_utils/conv/scipy/_to_dense.py = numba",
"src/fast_array_utils/numba/* = numba",
"src/fast_array_utils/stats/* = numba",
"src/fast_array_utils/_plugins/dask.py = dask",
"src/fast_array_utils/_plugins/numba_sparse.py = numba;scipy",
]
markers = [
"benchmark: marks tests as benchmark (to run with `--codspeed`)",
]
[tool.coverage]
run.data_file = "test-data/.coverage"
run.omit = [ "src/testing/*", "tests/*" ]
report.exclude_also = [ "@(numba[.])?njit", "[.]{3}", "if TYPE_CHECKING:" ]
html.directory = "test-data/htmlcov"
xml.output = "test-data/coverage.xml"