-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
175 lines (160 loc) · 5.73 KB
/
pyproject.toml
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
[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 = "[email protected]" },
]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = [ "description", "readme", "version" ]
dependencies = [ "numpy" ]
optional-dependencies.accel = [ "numba" ]
optional-dependencies.doc = [
"furo",
"pytest",
"scanpydoc>=0.15.2",
"sphinx>=8",
"sphinx-autodoc-typehints",
"sphinx-autofixture",
]
optional-dependencies.full = [ "dask", "fast-array-utils[accel,sparse]", "h5py", "zarr" ]
optional-dependencies.sparse = [ "scipy>=1.8" ]
optional-dependencies.test = [
"anndata",
"fast-array-utils[accel,test-min]",
"numcodecs<0.16", # zarr 2 needs this
"zarr<3", # anndata needs this
]
optional-dependencies.test-min = [
"coverage[toml]",
"fast-array-utils[testing,sparse]", # include sparse for testing numba-less to_dense
"pytest",
"pytest-codspeed",
"pytest-doctestplus",
]
optional-dependencies.testing = [ "packaging" ]
urls.'Documentation' = "https://icb-fast-array-utils.readthedocs-hosted.com/"
urls.'Issue Tracker' = "https://github.com/scverse/fast-array-utils/issues"
urls.'Source Code' = "https://github.com/scverse/fast-array-utils"
entry-points.pytest11.fast_array_utils = "testing.fast_array_utils.pytest"
[tool.hatch.version]
source = "vcs"
raw-options = { local_scheme = "no-local-version" } # be able to publish dev version
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/x-rst"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.rst"
start-after = ".. begin"
[tool.hatch.metadata.hooks.docstring-description]
[tool.hatch.build.targets.wheel]
packages = [ "src/testing", "src/fast_array_utils" ]
[tool.hatch.envs.default]
installer = "uv"
[tool.hatch.envs.docs]
features = [ "doc" ]
scripts.build = "sphinx-build -M html docs docs/_build"
scripts.clean = "git clean -fdX docs"
scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
[tool.hatch.envs.hatch-test]
default-args = [ ]
features = [ "test-min" ]
extra-dependencies = [ "ipykernel", "ipycytoscape" ]
env-vars.CODSPEED_PROFILE_FOLDER = "test-data/codspeed"
overrides.matrix.extras.features = [
{ if = [ "full" ], value = "full" },
{ if = [ "default", "full" ], value = "test" },
]
overrides.matrix.extras.dependencies = [
{ if = [ "full" ], value = "scipy-stubs" },
]
[[tool.hatch.envs.hatch-test.matrix]]
python = [ "3.13", "3.12", "3.11" ]
extras = [ "full", "default", "min" ]
[tool.ruff]
line-length = 100
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
"PLR0913", # having many (kw)args is fine
"Q", # handled by formatter
"S101", # asserts are fine
"TID252", # relative imports are fine
]
lint.per-file-ignores."docs/**/*.py" = [ "INP001" ] # No __init__.py in docs
lint.per-file-ignores."src/**/stats/*.py" = [ "A001", "A004" ] # Shadows builtins like `sum`
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`
]
lint.per-file-ignores."typings/**/*.pyi" = [ "A002", "F403", "F405", "N801" ] # Stubs don’t follow name conventions
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.isort.required-imports = [ "from __future__ import annotations" ]
lint.pydocstyle.convention = "numpy"
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"--strict-markers",
"--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/stats/* = numba",
"src/fast_array_utils/_plugins/dask.py = dask",
"src/fast_array_utils/_plugins/numba_sparse.py = numba;scipy",
]
filterwarnings = [
"error",
# codspeed seems to break this dtype added by h5py
"ignore:.*numpy[.]longdouble:UserWarning",
]
markers = [
"benchmark: marks tests as benchmark (to run with `--codspeed`)",
]
xfail_strict = true
[tool.coverage]
run.data_file = "test-data/.coverage"
xml.output = "test-data/coverage.xml"
html.directory = "test-data/htmlcov"
run.omit = [ "src/testing/*", "tests/*" ]
report.exclude_also = [ "if TYPE_CHECKING:", "@numba[.]njit", "[.]{3}" ]
[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