diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f4f94c5..2a1090b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,12 +12,12 @@ repos: - id: prettier - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.6.0" + rev: "v2.20.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.3 + rev: v0.15.8 hooks: - id: ruff types_or: [python, pyi, jupyter] @@ -26,7 +26,7 @@ repos: types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: detect-private-key - id: check-ast @@ -49,7 +49,7 @@ repos: files: '.*\.rej$' - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.1 + rev: v1.19.1 hooks: - id: mypy args: [--no-strict-optional, --ignore-missing-imports] diff --git a/pyproject.toml b/pyproject.toml index 1875e45..aee9446 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,26 +62,20 @@ urls.Documentation = "https://spatialdata-db.readthedocs.io/" urls.Homepage = "https://github.com/timtreis/spatialdata-db" urls.Source = "https://github.com/timtreis/spatialdata-db" -[tool.hatch.envs.default] -installer = "uv" -features = [ "dev" ] - -[tool.hatch.envs.docs] -extra-features = [ "doc" ] -scripts.build = "sphinx-build -M html docs docs/_build {args}" -scripts.open = "python -m webbrowser -t docs/_build/html/index.html" -scripts.clean = "git clean -fdX -- {args:docs}" - -[tool.hatch.envs.hatch-test] -features = [ "test" ] +[tool.hatch] +envs.default.installer = "uv" +envs.default.features = [ "dev" ] +envs.docs.extra-features = [ "doc" ] +envs.docs.scripts.build = "sphinx-build -M html docs docs/_build {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.features = [ "test" ] [tool.ruff] line-length = 120 src = [ "src" ] extend-include = [ "*.ipynb" ] - format.docstring-code-format = true - lint.select = [ "B", # flake8-bugbear "BLE", # flake8-blind-except @@ -115,18 +109,18 @@ lint.per-file-ignores."docs/*" = [ "I" ] lint.per-file-ignores."tests/*" = [ "D" ] lint.pydocstyle.convention = "numpy" -[tool.pytest.ini_options] -testpaths = [ "tests" ] -xfail_strict = true -addopts = [ +[tool.pytest] +ini_options.testpaths = [ "tests" ] +ini_options.xfail_strict = true +ini_options.addopts = [ "--import-mode=importlib", # allow using test files with same name ] -[tool.coverage.run] -source = [ "spatialdata_db" ] -omit = [ +[tool.coverage] +run.omit = [ "**/test_*.py", ] +run.source = [ "spatialdata_db" ] [tool.cruft] skip = [ @@ -140,28 +134,16 @@ skip = [ "docs/notebooks/example.ipynb", ] -[tool.pixi.workspace] -channels = ["conda-forge"] -platforms = ["osx-arm64", "linux-64"] - -[tool.pixi.dependencies] -python = ">=3.11" -pip = ">=25.2,<26" -multipledispatch = ">=0.6.0,<0.7" - -[tool.pixi.pypi-dependencies] -spatialdata-db = { path = ".", editable = true } - -[tool.pixi.feature.py311.dependencies] -python = "3.11.*" - -[tool.pixi.feature.py313.dependencies] -python = "3.13.*" - -[tool.pixi.environments] -default = { features = ["py313"], solve-group = "py313" } -dev-py311 = { features = ["dev", "test", "py311"], solve-group = "py311" } -dev-py313 = { features = ["dev", "test", "py313"], solve-group = "py313" } - -[tool.pixi.tasks] -kernel-install = "python -m ipykernel install --user --name pixi-dev --display-name \"spatialdata-db (dev)\"" +[tool.pixi] +dependencies.python = ">=3.11" +dependencies.pip = ">=25.2,<26" +dependencies.multipledispatch = ">=0.6.0,<0.7" +environments.default = { features = [ "py313" ], solve-group = "py313" } +environments.dev-py311 = { features = [ "dev", "test", "py311" ], solve-group = "py311" } +environments.dev-py313 = { features = [ "dev", "test", "py313" ], solve-group = "py313" } +feature.py311.dependencies.python = "3.11.*" +feature.py313.dependencies.python = "3.13.*" +pypi-dependencies.spatialdata-db = { path = ".", editable = true } +tasks.kernel-install = 'python -m ipykernel install --user --name pixi-dev --display-name "spatialdata-db (dev)"' +workspace.channels = [ "conda-forge" ] +workspace.platforms = [ "osx-arm64", "linux-64" ] diff --git a/scripts/parse_10X_ST_table.ipynb b/scripts/parse_10X_ST_table.ipynb index 995e514..cb70c63 100644 --- a/scripts/parse_10X_ST_table.ipynb +++ b/scripts/parse_10X_ST_table.ipynb @@ -1129,7 +1129,9 @@ ], "source": [ "all_data[\"id\"] = all_data.apply(\n", - " lambda row: f\"{row['uid']}__10X__{row['tech']}__{row['Species']}__{row['organ']}__{row['date']}__{row['Pipeline Version']}\",\n", + " lambda row: (\n", + " f\"{row['uid']}__10X__{row['tech']}__{row['Species']}__{row['organ']}__{row['date']}__{row['Pipeline Version']}\"\n", + " ),\n", " axis=1,\n", ")\n", "# optionally add replicate information if available\n",