Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/biomejs/pre-commit
rev: v2.3.10
rev: v2.4.7
hooks:
- id: biome-format
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.11.1
rev: v2.18.1
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.11
rev: v0.15.6
hooks:
- id: ruff-check
types_or: [python, pyi, jupyter]
Expand Down
79 changes: 30 additions & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ doc = [
"nbconvert",
"pycairo",
"sc-dandelion",
"sphinx>=7,<7.4", # https://github.com/sphinx-doc/sphinx/issues/12589
"sphinx>=7,<7.4", # https://github.com/sphinx-doc/sphinx/issues/12589
"sphinx-autodoc-typehints",
"sphinx-book-theme>=1",
"sphinx-copybutton",
Expand All @@ -90,55 +90,36 @@ doc = [
]
gpu = [ "scirpy[cupy]" ]

[tool.hatch.version]
source = "vcs"

[tool.hatch.envs.default]
installer = "uv"
dependency-groups = [ "dev" ]

[tool.hatch.envs.docs]
dependency-groups = [ "doc" ]
scripts.build = "sphinx-build -M html docs docs/_build -W {args}"
scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
scripts.clean = "git clean -fdX -- {args:docs}"
scripts.run_tutorial = "jupytext -k python3 --execute {args}"

[tool.hatch.envs.gpu]
python = "3.13"
dependency-groups = [ "gpu", "test", "dev" ]
scripts.test = "pytest -m gpu"

# Test the lowest and highest supported Python versions with normal deps
[[tool.hatch.envs.hatch-test.matrix]]
deps = [ "stable" ]
python = [ "3.12", "3.14" ]

# Test the lowest supported package versions with the lowest supported python version
[[tool.hatch.envs.hatch-test.matrix]]
deps = [ "minver" ]
python = [ "3.12" ]

# Test the newest supported Python version also with pre-release deps
[[tool.hatch.envs.hatch-test.matrix]]
deps = [ "pre" ]
python = [ "3.14" ]

[tool.hatch.envs.hatch-test]
dependency-groups = [ "dev", "test" ]
default-args = [
] # accounting for non-default tests path (specified via pytest.ini_options)

[tool.hatch.envs.hatch-test.overrides]
[tool.hatch]
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.docs.scripts.run_tutorial = "jupytext -k python3 --execute {args}"
envs.gpu.python = "3.13"
envs.gpu.dependency-groups = [ "gpu", "test", "dev" ]
envs.gpu.scripts.test = "pytest -m gpu"
envs.hatch-test.dependency-groups = [ "dev", "test" ]
envs.hatch-test.default-args = [] # accounting for non-default tests path (specified via pytest.ini_options)
envs.hatch-test.matrix = [
# Test the lowest and highest supported Python versions with normal deps
{ deps = [ "stable" ], python = [ "3.12", "3.14" ] },
# Test the lowest supported package versions with the lowest supported python version
{ deps = [ "minver" ], python = [ "3.12" ] },
# Test the newest supported Python version also with pre-release deps
{ deps = [ "pre" ], python = [ "3.14" ] },
]
# If the matrix variable `deps` is set to "pre",
# set the environment variable `UV_PRERELEASE` to "allow".
matrix.deps.env-vars = [
envs.hatch-test.overrides.matrix.deps.env-vars = [
{ key = "UV_PRERELEASE", value = "allow", if = [
"pre",
] },
]
# If the matrix variable `deps` is set to "minver", install minimum versions.
matrix.deps.dependencies = [
envs.hatch-test.overrides.matrix.deps.dependencies = [
{ value = "pandas<3", if = [
"minver",
] },
Expand All @@ -155,12 +136,12 @@ matrix.deps.dependencies = [
"minver",
] },
]
version.source = "vcs"

[tool.ruff]
line-length = 120
src = [ "src" ]
extend-include = [ "*.ipynb" ]

format.docstring-code-format = true
lint.select = [
"B", # flake8-bugbear
Expand Down Expand Up @@ -212,7 +193,7 @@ lint.ignore = [
]
lint.per-file-ignores."*.ipynb" = [
"E402",
] # Module level import not at top of cell
] # Module level import not at top of cell
lint.per-file-ignores."*/__init__.py" = [ "F401" ]
lint.per-file-ignores."docs/*" = [ "I" ]
lint.per-file-ignores."src/scirpy/datasets/_processing_scripts/*" = [
Expand All @@ -236,11 +217,11 @@ markers = [
"gpu: mark test to run on GPU",
]
minversion = "6.0"
norecursedirs = [ '.*', 'build', 'dist', '*.egg', 'data', '__pycache__' ]
norecursedirs = [ ".*", "build", "dist", "*.egg", "data", "__pycache__" ]

[tool.coverage.run]
source = [ "scirpy" ]
omit = [ "**/test_*.py" ]
[tool.coverage]
run.omit = [ "**/test_*.py" ]
run.source = [ "scirpy" ]

[tool.cruft]
skip = [
Expand Down
Loading