Skip to content

Commit 307e6bb

Browse files
authored
Merge branch 'main' into bugfix/issue1115-pkg_resources-not-founded-deprecated-since-python-312
2 parents f39af8d + 3c11223 commit 307e6bb

3 files changed

Lines changed: 51 additions & 76 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ default_stages:
77
minimum_pre_commit_version: 2.16.0
88
repos:
99
- repo: https://github.com/biomejs/pre-commit
10-
rev: v2.3.10
10+
rev: v2.3.15
1111
hooks:
1212
- id: biome-format
1313
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
1414
- repo: https://github.com/tox-dev/pyproject-fmt
15-
rev: v2.11.1
15+
rev: v2.16.0
1616
hooks:
1717
- id: pyproject-fmt
1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.14.11
19+
rev: v0.15.1
2020
hooks:
2121
- id: ruff-check
2222
types_or: [python, pyi, jupyter]

pyproject.toml

Lines changed: 47 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ keywords = [
1515
]
1616
license = "BSD-3-Clause"
1717
maintainers = [
18-
{ name = "Tim Treis", email = "tim.treis@scverse.org" },
1918
{ name = "Selman Ozleyen", email = "selman.ozleyen@helmholtz-munich.de" },
19+
{ name = "Tim Treis", email = "tim.treis@scverse.org" },
2020
]
2121
authors = [
2222
{ name = "scverse" },
@@ -76,7 +76,6 @@ dependencies = [
7676
"xarray>=2024.10",
7777
"zarr>=3",
7878
]
79-
8079
optional-dependencies.dev = [
8180
"hatch>=1.9",
8281
"ipykernel",
@@ -128,17 +127,11 @@ include-package-data = true
128127

129128
[tool.setuptools_scm]
130129

131-
[tool.hatch.version]
132-
source = "vcs"
133-
134-
[tool.hatch.build.hooks.vcs]
135-
version-file = "_version.py"
136-
137-
[tool.hatch.metadata]
138-
allow-direct-references = true
139-
140-
[tool.hatch.build.targets.wheel]
141-
packages = [ "src/squidpy" ]
130+
[tool.hatch]
131+
build.hooks.vcs.version-file = "_version.py"
132+
build.targets.wheel.packages = [ "src/squidpy" ]
133+
metadata.allow-direct-references = true
134+
version.source = "vcs"
142135

143136
[tool.ruff]
144137
line-length = 120
@@ -151,7 +144,6 @@ exclude = [
151144
"docs/_build",
152145
"setup.py",
153146
]
154-
155147
format.docstring-code-format = true
156148
lint.select = [
157149
"B", # flake8-bugbear
@@ -161,8 +153,8 @@ lint.select = [
161153
"F", # pyflakes
162154
"I", # isort
163155
# below are not autofixed
164-
"UP", # pyupgrade
165-
"W", # pycodestyle
156+
"UP", # pyupgrade
157+
"W", # pycodestyle
166158
]
167159
# "squidpy/*.py"= ["RST303"]
168160
lint.ignore = [
@@ -234,84 +226,46 @@ lint.unfixable = [
234226
lint.flake8-tidy-imports.ban-relative-imports = "all"
235227
lint.isort.required-imports = [ "from __future__ import annotations" ]
236228

237-
[tool.pytest.ini_options]
238-
filterwarnings = [
229+
[tool.pytest]
230+
ini_options.filterwarnings = [
239231
"error::numba.NumbaPerformanceWarning",
240232
"ignore::UserWarning",
241233
"ignore::anndata.OldFormatWarning",
242234
"ignore:.*pkg_resources:DeprecationWarning",
243235
]
244-
python_files = "test_*.py"
245-
testpaths = [ "tests/" ]
246-
xfail_strict = true
247-
addopts = [
236+
ini_options.python_files = "test_*.py"
237+
ini_options.testpaths = [ "tests/" ]
238+
ini_options.xfail_strict = true
239+
ini_options.addopts = [
248240
"--ignore=tests/plotting/test_interactive.py",
249241
"--ignore=docs",
250242
]
251243

252-
[tool.coverage.run]
253-
branch = true
254-
parallel = true
255-
source = [ "squidpy" ]
256-
omit = [
244+
[tool.coverage]
245+
run.branch = true
246+
run.omit = [
257247
"*/__init__.py",
258248
"*/_version.py",
259249
"squidpy/pl/_interactive/*",
260250
"tox/*",
261251
]
262-
263-
[tool.coverage.paths]
264-
source = [
252+
run.parallel = true
253+
run.source = [ "squidpy" ]
254+
paths.source = [
265255
"squidpy",
266256
"*/site-packages/squidpy",
267257
]
268-
269-
[tool.coverage.report]
270-
exclude_lines = [
258+
report.exclude_lines = [
271259
"\\#.*pragma:\\s*no.?cover",
272-
"^if __name__ == .__main__.:$",
273260
"^\\s*raise AssertionError\\b",
274261
"^\\s*raise NotImplementedError\\b",
275262
"^\\s*return NotImplemented\\b",
263+
"^if __name__ == .__main__.:$",
276264
]
277-
show_missing = true
278-
precision = 2
279-
skip_empty = true
280-
sort = "Miss"
281-
282-
[tool.pixi.workspace]
283-
channels = [ "conda-forge" ]
284-
platforms = [ "osx-arm64", "linux-64" ]
285-
286-
[tool.pixi.dependencies]
287-
python = ">=3.11"
288-
289-
[tool.pixi.pypi-dependencies]
290-
squidpy = { path = ".", editable = true }
291-
292-
[tool.pixi.feature.py311.dependencies]
293-
python = "3.11.*"
294-
295-
[tool.pixi.feature.py313.dependencies]
296-
python = "3.13.*"
297-
298-
[tool.pixi.environments]
299-
dev-py311 = { features = [ "dev", "test", "py311" ], solve-group = "py311" }
300-
docs-py311 = { features = [ "docs", "py311" ], solve-group = "py311" }
301-
302-
default = { features = [ "py313" ], solve-group = "py313" }
303-
dev-py313 = { features = [ "dev", "test", "py313" ], solve-group = "py313" }
304-
docs-py313 = { features = [ "docs", "py313" ], solve-group = "py313" }
305-
test-py313 = { features = [ "test", "py313" ], solve-group = "py313" }
306-
307-
[tool.pixi.tasks]
308-
lab = "jupyter lab"
309-
kernel-install = "python -m ipykernel install --user --name pixi-dev --display-name \"squidpy (dev)\""
310-
test = "pytest -v --color=yes --tb=short --durations=10"
311-
lint = "ruff check ."
312-
format = "ruff format ."
313-
pre-commit-install = "pre-commit install"
314-
pre-commit = "pre-commit run"
265+
report.precision = 2
266+
report.show_missing = true
267+
report.skip_empty = true
268+
report.sort = "Miss"
315269

316270
[tool.cruft]
317271
skip = [
@@ -324,3 +278,24 @@ skip = [
324278
"docs/references.md",
325279
"docs/notebooks/example.ipynb",
326280
]
281+
282+
[tool.pixi]
283+
dependencies.python = ">=3.11"
284+
environments.dev-py311 = { features = [ "dev", "test", "py311" ], solve-group = "py311" }
285+
environments.docs-py311 = { features = [ "docs", "py311" ], solve-group = "py311" }
286+
environments.default = { features = [ "py313" ], solve-group = "py313" }
287+
environments.dev-py313 = { features = [ "dev", "test", "py313" ], solve-group = "py313" }
288+
environments.docs-py313 = { features = [ "docs", "py313" ], solve-group = "py313" }
289+
environments.test-py313 = { features = [ "test", "py313" ], solve-group = "py313" }
290+
feature.py311.dependencies.python = "3.11.*"
291+
feature.py313.dependencies.python = "3.13.*"
292+
pypi-dependencies.squidpy = { path = ".", editable = true }
293+
tasks.lab = "jupyter lab"
294+
tasks.kernel-install = 'python -m ipykernel install --user --name pixi-dev --display-name "squidpy (dev)"'
295+
tasks.test = "pytest -v --color=yes --tb=short --durations=10"
296+
tasks.lint = "ruff check ."
297+
tasks.format = "ruff format ."
298+
tasks.pre-commit-install = "pre-commit install"
299+
tasks.pre-commit = "pre-commit run"
300+
workspace.channels = [ "conda-forge" ]
301+
workspace.platforms = [ "osx-arm64", "linux-64" ]

src/squidpy/gr/_niche.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def calculate_niche(
245245
for col in result_columns:
246246
if col in lib_result.obs.columns:
247247
prefixed_values = lib_result.obs[col].apply(
248-
lambda x, lib=lib_id: (f"lib={lib}_{x}" if x != "not_a_niche" else x)
248+
lambda x, lib=lib_id: f"lib={lib}_{x}" if x != "not_a_niche" else x
249249
)
250250

251251
adata.obs.loc[lib_indices, col] = prefixed_values.values

0 commit comments

Comments
 (0)