From d4ce145bc39117aa723de3e541dcfdfdffcd9420 Mon Sep 17 00:00:00 2001 From: Severin Dicks <37635888+Intron7@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:05:18 +0100 Subject: [PATCH] Update pre-commit (#326) * update precommit * update pre-commit --- .pre-commit-config.yaml | 12 ++++++-- .taplo.toml | 5 ++++ docs/_static/css/override.css | 14 +++++----- hatch.toml | 8 +++--- pyproject.toml | 52 +++++++++++++++++------------------ 5 files changed, 51 insertions(+), 40 deletions(-) create mode 100644 .taplo.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 537fad81..da82e289 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,15 +3,21 @@ repos: rev: v0.9.6 hooks: - id: ruff - types_or: [python, pyi, jupyter] args: ["--fix"] - id: ruff-format - types_or: [python, pyi, jupyter] # The following can be removed once PLR0917 is out of preview - name: ruff preview rules id: ruff - types_or: [python, pyi, jupyter] args: ["--preview", "--select=PLR0917"] +- repo: https://github.com/biomejs/pre-commit + rev: v0.6.1 + hooks: + - id: biome-format + additional_dependencies: ["@biomejs/biome@1.9.4"] +- repo: https://github.com/ComPWA/taplo-pre-commit + rev: v0.9.3 + hooks: + - id: taplo-format - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 00000000..41a6cdc5 --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,5 @@ +[formatting] +array_auto_collapse = false +column_width = 120 +compact_arrays = false +indent_string = ' ' diff --git a/docs/_static/css/override.css b/docs/_static/css/override.css index c0b4579d..3c26d0d5 100644 --- a/docs/_static/css/override.css +++ b/docs/_static/css/override.css @@ -1,20 +1,20 @@ /* for the sphinx design cards */ body { - --sd-color-shadow: dimgrey; + --sd-color-shadow: dimgrey; } -dl.citation>dt { - float: left; - margin-right: 15px; - font-weight: bold; +dl.citation > dt { + float: left; + margin-right: 15px; + font-weight: bold; } /* for custom small role */ .small { - font-size: 40% !important + font-size: 40% !important; } .smaller, .pr { - font-size: 70% !important + font-size: 70% !important; } diff --git a/hatch.toml b/hatch.toml index e3b2ce0c..2758a2d5 100644 --- a/hatch.toml +++ b/hatch.toml @@ -1,16 +1,16 @@ [envs.default] installer = "uv" -features = ["dev"] +features = [ "dev" ] [envs.hatch-test] -features = ["test", "rapids12"] +features = [ "test", "rapids12" ] [envs.docs] -features = ["doc"] +features = [ "doc" ] scripts.build = "sphinx-build -M html docs docs/_build {args}" scripts.clean = "git clean -fXd docs" [envs.default.pip] extra_index_urls = [ - "https://pypi.nvidia.com" + "https://pypi.nvidia.com", ] diff --git a/pyproject.toml b/pyproject.toml index 189d5457..e6fb5362 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,15 @@ [build-system] -requires = ["hatchling", "hatch-vcs"] +requires = [ "hatchling", "hatch-vcs" ] build-backend = "hatchling.build" [project] name = "rapids_singlecell" description = "running single cell analysis on Nvidia GPUs" -requires-python = ">=3.10, <3.13" -license = {file = "LICENSE"} -authors = [{name = "Severin Dicks"}] -readme = {file = "README.md", content-type="text/markdown"} -dynamic = ["version"] +requires-python = ">=3.10, <3.13" +license = { file = "LICENSE" } +authors = [ { name = "Severin Dicks" } ] +readme = { file = "README.md", content-type = "text/markdown" } +dynamic = [ "version" ] dependencies = [ "anndata>=0.10.0", @@ -26,8 +26,8 @@ dependencies = [ ] [project.optional-dependencies] -rapids11 = ["cupy-cuda11x","cudf-cu11==24.12.*", "cuml-cu11==24.12.*", "cugraph-cu11==24.12.*","numba < 0.61.0"] -rapids12 = ["cupy-cuda12x","cudf-cu12==24.12.*", "cuml-cu12==24.12.*", "cugraph-cu12==24.12.*", "numba < 0.61.0"] +rapids11 = [ "cupy-cuda11x", "cudf-cu11==24.12.*", "cuml-cu11==24.12.*", "cugraph-cu11==24.12.*", "numba < 0.61.0" ] +rapids12 = [ "cupy-cuda12x", "cudf-cu12==24.12.*", "cuml-cu12==24.12.*", "cugraph-cu12==24.12.*", "numba < 0.61.0" ] doc = [ "sphinx>=4.5.0", "sphinx-copybutton", @@ -51,17 +51,17 @@ Documentation = "https://rapids-singlecell.readthedocs.io" Source = "https://github.com/scverse/rapids_singlecell" [tool.ruff] -src = ["src"] +src = [ "src" ] line-length = 88 lint.select = [ - "F", # Errors detected by Pyflakes - "E", # Error detected by Pycodestyle - "W", # Warning detected by Pycodestyle - "I", # isort - "TID", # flake8-tidy-imports - "C4", # flake8-comprehensions - "BLE", # flake8-blind-except - "UP", # pyupgrade + "F", # Errors detected by Pyflakes + "E", # Error detected by Pycodestyle + "W", # Warning detected by Pycodestyle + "I", # isort + "TID", # flake8-tidy-imports + "C4", # flake8-comprehensions + "BLE", # flake8-blind-except + "UP", # pyupgrade "TID251", # Banned imports "RUF100", # Report unused noqa directives "ICN", # Follow import conventions @@ -82,14 +82,14 @@ lint.ignore = [ ] [tool.ruff.lint.per-file-ignores] -"docs/*" = ["I"] -"tests/*" = ["D"] -"*/__init__.py" = ["F401"] -"src/rapids_singlecell/decoupler_gpu/_method_mlm.py" = ["PLR0917"] -"src/rapids_singlecell/decoupler_gpu/_method_wsum.py" = ["PLR0917"] +"docs/*" = [ "I" ] +"tests/*" = [ "D" ] +"*/__init__.py" = [ "F401" ] +"src/rapids_singlecell/decoupler_gpu/_method_mlm.py" = [ "PLR0917" ] +"src/rapids_singlecell/decoupler_gpu/_method_wsum.py" = [ "PLR0917" ] [tool.ruff.lint.isort] -known-first-party = ["rapids_singlecell"] -required-imports = ["from __future__ import annotations"] +known-first-party = [ "rapids_singlecell" ] +required-imports = [ "from __future__ import annotations" ] [tool.pytest.ini_options] addopts = [ @@ -106,7 +106,7 @@ exclude = [ "src/rapids_singlecell/_testing.py", "tests", "docs", - "notebooks" + "notebooks", ] [tool.hatch.build.hooks.vcs] version-file = "src/rapids_singlecell/_version.py" @@ -115,7 +115,7 @@ version-file = "src/rapids_singlecell/_version.py" source = "vcs" [tool.hatch.build.targets.wheel] -packages = ['src/rapids_singlecell'] +packages = [ 'src/rapids_singlecell' ] [tool.codespell] skip = '*.ipynb,*.csv'