-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpyproject.toml
More file actions
204 lines (195 loc) · 6.15 KB
/
pyproject.toml
File metadata and controls
204 lines (195 loc) · 6.15 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
[build-system]
build-backend = "hatchling.build"
requires = [ "hatch-vcs", "hatchling" ]
[project]
name = "spatialdata-plot"
description = "Static plotting for spatial data."
readme = "README.md"
license = { file = "LICENSE" }
maintainers = [
{ name = "Tim Treis", email = "tim.treis@helmholtz-munich.de" },
]
authors = [
{ name = "scverse" },
]
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = [
"version", # allow version to be set by git tags
]
dependencies = [
"matplotlib",
"matplotlib-scalebar",
"scanpy",
"scikit-learn",
"spatialdata>=0.3",
]
urls.Documentation = "https://spatialdata.scverse.org/projects/plot/en/latest/index.html"
urls.Home-page = "https://github.com/scverse/spatialdata-plot.git"
urls.Source = "https://github.com/scverse/spatialdata-plot.git"
[dependency-groups]
dev = [
"pre-commit",
"twine>=4.0.2",
]
test = [
"coverage[toml]>=7.4",
"pooch",
"pytest",
"pytest-cov",
"pytest-xdist[psutil]",
]
doc = [
"ipykernel",
"ipython>=8.6",
"myst-nb>=1.1",
"sphinx>=8.1",
"sphinx-autodoc-typehints",
"sphinx-book-theme>=1",
"sphinx-copybutton",
"sphinx-tabs",
"sphinxcontrib-bibtex>=1",
"sphinxcontrib-katex",
"sphinxext-opengraph",
]
[tool.hatch]
build.hooks.vcs.version-file = "_version.py"
build.targets.wheel.packages = [ "src/spatialdata_plot" ]
envs.default.installer = "uv"
envs.default.dependency-groups = [ "dev" ]
envs.docs.dependency-groups = [ "doc" ]
envs.docs.scripts.build = "sphinx-build -M html docs docs/_build -W {args}"
envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
envs.docs.scripts.clean = "git clean -fdX -- {args:docs}"
envs.hatch-test.dependency-groups = [ "test" ]
envs.hatch-test.matrix = [
{ deps = [ "stable" ], python = [ "3.11", "3.14" ] },
{ deps = [ "pre" ], python = [ "3.14" ] }
]
envs.hatch-test.overrides.matrix.deps.env-vars = [
{ key = "UV_PRERELEASE", value = "allow", if = [ "pre" ] },
]
envs.hatch-test.scripts.run = "pytest{env:HATCH_TEST_ARGS:} -p no:cov {args}"
envs.hatch-test.scripts.run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} -p no:cov {args}"
envs.hatch-test.scripts.cov-combine = "coverage combine"
envs.hatch-test.scripts.cov-report = [ "coverage report", "coverage xml -o coverage.xml" ]
metadata.allow-direct-references = true
version.source = "vcs"
[tool.ruff]
line-length = 120
exclude = [
".git",
".tox",
"__pycache__",
"build",
"dist",
"docs/_build",
"setup.py",
]
lint.select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # flake8-docstrings
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"NPY", # NumPy-specific rules
"PGH", # pygrep-hooks
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-raise
"SIM", # flake8-simplify
"T20", # flake8-print
"TID", # flake-8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle
]
lint.ignore = [
# Do not perform function calls in argument defaults.
"B008",
# Missing docstring in public module
"D100",
# Missing docstring in public package
"D104",
# Missing docstring in magic method
"D105",
# Missing docstring in __init__
"D107",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
# allow I, O, l as variable names -> I is the identity matrix, i, j, k, l is reasonable indexing notation
"E741",
]
lint.per-file-ignores."*/__init__.py" = [ "D104", "D107", "E402", "F401" ]
lint.per-file-ignores."docs/*" = [ "A", "B", "D", "E" ]
lint.per-file-ignores."src/spatialdata_plot/pl/utils.py" = [ "PGH003" ]
lint.per-file-ignores."tests/*" = [ "B024", "D", "PT" ]
lint.per-file-ignores."tests/conftest.py" = [ "E402", "RET504" ]
lint.unfixable = [ "B", "BLE", "C4", "RET", "T20", "UP" ]
lint.pydocstyle.convention = "numpy"
[tool.pytest]
ini_options.testpaths = [ "tests" ]
ini_options.xfail_strict = true
ini_options.addopts = [
# "-Werror", # if 3rd party libs raise DeprecationWarnings, just use filterwarnings below
"--import-mode=importlib", # allow using test files with same name
"-s", # print output from tests
]
# info on how to use this https://stackoverflow.com/questions/57925071/how-do-i-avoid-getting-deprecationwarning-from-inside-dependencies-with-pytest
ini_options.filterwarnings = [
# "ignore:.*U.*mode is deprecated:DeprecationWarning",
]
[tool.coverage]
run.branch = true
run.omit = [
"**/test_*.py",
]
run.parallel = true
run.source = [ "spatialdata_plot" ]
paths.source = [
"src/spatialdata_plot",
"*/site-packages/spatialdata_plot",
]
[tool.jupytext]
formats = "ipynb,md"
[tool.cruft]
skip = [
"tests",
"src/**/__init__.py",
"src/**/basic.py",
"docs/api.md",
"docs/changelog.md",
"docs/references.bib",
"docs/references.md",
"docs/notebooks/example.ipynb",
]
[tool.pixi]
dependencies.python = ">=3.11"
# 3.11 lane (for gh-actions)
environments.dev-py311 = { features = [ "dev", "test", "py311" ], solve-group = "py311" }
environments.docs-py311 = { features = [ "doc", "py311" ], solve-group = "py311" }
# 3.13 lane
environments.default = { features = [ "py313" ], solve-group = "py313" }
environments.dev-py313 = { features = [ "dev", "test", "py313" ], solve-group = "py313" }
environments.docs-py313 = { features = [ "doc", "py313" ], solve-group = "py313" }
environments.test-py313 = { features = [ "test", "py313" ], solve-group = "py313" }
# for gh-actions
feature.py311.dependencies.python = "3.11.*"
feature.py313.dependencies.python = "3.13.*"
pypi-dependencies.spatialdata-plot = { path = ".", editable = true }
tasks.lab = "jupyter lab"
tasks.kernel-install = 'python -m ipykernel install --user --name pixi-dev --display-name "sdata-plot (dev)"'
tasks.test = "pytest -v --color=yes --tb=short --durations=10"
tasks.lint = "ruff check ."
tasks.format = "ruff format ."
tasks.pre-commit-install = "pre-commit install"
tasks.pre-commit-run = "pre-commit run --all-files"
workspace.channels = [ "conda-forge" ]
workspace.platforms = [ "osx-arm64", "linux-64" ]