From 9068987088567ca9ba41842135be3d3189b9ed01 Mon Sep 17 00:00:00 2001 From: scverse-bot Date: Thu, 22 Feb 2024 18:42:05 +0000 Subject: [PATCH 1/2] Update template to v0.3.1 --- .cruft.json | 7 +++--- .pre-commit-config.yaml.rej | 34 +++++++++++++++++++++++++ pyproject.toml | 4 +-- pyproject.toml.rej | 50 +++++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 .pre-commit-config.yaml.rej create mode 100644 pyproject.toml.rej diff --git a/.cruft.json b/.cruft.json index 898d8a9..adf613b 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,7 +1,7 @@ { "template": "https://github.com/scverse/cookiecutter-scverse", - "commit": "8e96abb5c3e2d5078c44713958da672711cf2a48", - "checkout": "v0.3.0", + "commit": "586b1652162ff7994b0070a034023d64289ae416", + "checkout": "v0.3.1", "context": { "cookiecutter": { "project_name": "scverse-tutorials", @@ -13,7 +13,8 @@ "project_repo": "https://github.com/scverse/scverse-tutorials", "license": "BSD 3-Clause License", "_copy_without_render": [ - ".github/workflows/**.yaml", + ".github/workflows/build.yaml", + ".github/workflows/test.yaml", "docs/_templates/autosummary/**.rst" ], "_render_devdocs": false, diff --git a/.pre-commit-config.yaml.rej b/.pre-commit-config.yaml.rej new file mode 100644 index 0000000..831fbdc --- /dev/null +++ b/.pre-commit-config.yaml.rej @@ -0,0 +1,34 @@ +diff a/.pre-commit-config.yaml b/.pre-commit-config.yaml (rejected hunks) +@@ -6,29 +6,18 @@ default_stages: + - push + minimum_pre_commit_version: 2.16.0 + repos: +- - repo: https://github.com/psf/black +- rev: "24.2.0" +- hooks: +- - id: black +- - repo: https://github.com/asottile/blacken-docs +- rev: 1.16.0 +- hooks: +- - id: blacken-docs + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier +- # Newer versions of node don't work on systems that have an older version of GLIBC +- # (in particular Ubuntu 18.04 and Centos 7) +- # EOL of Centos 7 is in 2024-06, we can probably get rid of this then. +- # See https://github.com/scverse/cookiecutter-scverse/issues/143 and +- # https://github.com/jupyterlab/jupyterlab/issues/12675 +- language_version: "17.9.1" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.2.2 + hooks: + - id: ruff ++ types_or: [python, pyi, jupyter] + args: [--fix, --exit-non-zero-on-fix] ++ - id: ruff-format ++ types_or: [python, pyi, jupyter] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: diff --git a/pyproject.toml b/pyproject.toml index 20819de..eabb62b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ select = [ "RUF100", # Report unused noqa directives ] ignore = [ - # line too long -> we accept long comment lines; black gets rid of long code lines + # line too long -> we accept long comment lines; formatter gets rid of long code lines "E501", # Do not assign a lambda expression, use a def -> lambda expression assignments are convenient "E731", @@ -125,5 +125,5 @@ skip = [ "docs/changelog.md", "docs/references.bib", "docs/references.md", - "docs/notebooks/example.ipynb" + "docs/notebooks/example.ipynb", ] diff --git a/pyproject.toml.rej b/pyproject.toml.rej new file mode 100644 index 0000000..09e9716 --- /dev/null +++ b/pyproject.toml.rej @@ -0,0 +1,50 @@ +diff a/pyproject.toml b/pyproject.toml (rejected hunks) +@@ -21,13 +21,13 @@ urls.Home-page = "https://github.com/scverse/scverse-tutorials" + dependencies = [ + "anndata", + # for debug logging (referenced from the issue template) +- "session-info" ++ "session-info", + ] + + [project.optional-dependencies] + dev = [ + "pre-commit", +- "twine>=4.0.2" ++ "twine>=4.0.2", + ] + doc = [ + "docutils>=0.8,!=0.18.*,!=0.19.*", +@@ -61,12 +61,15 @@ addopts = [ + "--import-mode=importlib", # allow using test files with same name + ] + +-[tool.black] +-line-length = 120 +- + [tool.ruff] +-src = ["src"] + line-length = 120 ++src = ["src"] ++extend-include = ["*.ipynb"] ++ ++[tool.ruff.format] ++docstring-code-format = true ++ ++[tool.ruff.lint] + select = [ + "F", # Errors detected by Pyflakes + "E", # Error detected by Pycodestyle +@@ -108,10 +111,10 @@ ignore = [ + "D213", + ] + +-[tool.ruff.pydocstyle] ++[tool.ruff.lint.pydocstyle] + convention = "numpy" + +-[tool.ruff.per-file-ignores] ++[tool.ruff.lint.per-file-ignores] + "docs/*" = ["I"] + "tests/*" = ["D"] + "*/__init__.py" = ["F401"] From 7a74e19e83377f462e054085066acc53dbf5b8c4 Mon Sep 17 00:00:00 2001 From: Philipp A Date: Fri, 23 Feb 2024 08:54:31 +0100 Subject: [PATCH 2/2] migrate changes --- .pre-commit-config.yaml.rej | 34 ------------------------- pyproject.toml | 10 +++++--- pyproject.toml.rej | 50 ------------------------------------- 3 files changed, 6 insertions(+), 88 deletions(-) delete mode 100644 .pre-commit-config.yaml.rej delete mode 100644 pyproject.toml.rej diff --git a/.pre-commit-config.yaml.rej b/.pre-commit-config.yaml.rej deleted file mode 100644 index 831fbdc..0000000 --- a/.pre-commit-config.yaml.rej +++ /dev/null @@ -1,34 +0,0 @@ -diff a/.pre-commit-config.yaml b/.pre-commit-config.yaml (rejected hunks) -@@ -6,29 +6,18 @@ default_stages: - - push - minimum_pre_commit_version: 2.16.0 - repos: -- - repo: https://github.com/psf/black -- rev: "24.2.0" -- hooks: -- - id: black -- - repo: https://github.com/asottile/blacken-docs -- rev: 1.16.0 -- hooks: -- - id: blacken-docs - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier -- # Newer versions of node don't work on systems that have an older version of GLIBC -- # (in particular Ubuntu 18.04 and Centos 7) -- # EOL of Centos 7 is in 2024-06, we can probably get rid of this then. -- # See https://github.com/scverse/cookiecutter-scverse/issues/143 and -- # https://github.com/jupyterlab/jupyterlab/issues/12675 -- language_version: "17.9.1" - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.2 - hooks: - - id: ruff -+ types_or: [python, pyi, jupyter] - args: [--fix, --exit-non-zero-on-fix] -+ - id: ruff-format -+ types_or: [python, pyi, jupyter] - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: diff --git a/pyproject.toml b/pyproject.toml index eabb62b..0b8ad2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,8 +60,11 @@ bypass-selection = true # This is not a package line-length = 120 [tool.ruff] -src = ["src"] line-length = 120 +src = ["src"] +extend-include = ["*.ipynb"] + +[tool.ruff.lint] select = [ "F", # Errors detected by Pyflakes "E", # Error detected by Pycodestyle @@ -102,12 +105,11 @@ ignore = [ # We want docstrings to start immediately after the opening triple quote "D213", ] -extend-include = ["*.ipynb"] -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "numpy" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "docs/*" = [ "B018", # Trailing expressions in notebooks are not “useless” "D103", # No need for docstrings in functions, we use literate programming diff --git a/pyproject.toml.rej b/pyproject.toml.rej deleted file mode 100644 index 09e9716..0000000 --- a/pyproject.toml.rej +++ /dev/null @@ -1,50 +0,0 @@ -diff a/pyproject.toml b/pyproject.toml (rejected hunks) -@@ -21,13 +21,13 @@ urls.Home-page = "https://github.com/scverse/scverse-tutorials" - dependencies = [ - "anndata", - # for debug logging (referenced from the issue template) -- "session-info" -+ "session-info", - ] - - [project.optional-dependencies] - dev = [ - "pre-commit", -- "twine>=4.0.2" -+ "twine>=4.0.2", - ] - doc = [ - "docutils>=0.8,!=0.18.*,!=0.19.*", -@@ -61,12 +61,15 @@ addopts = [ - "--import-mode=importlib", # allow using test files with same name - ] - --[tool.black] --line-length = 120 -- - [tool.ruff] --src = ["src"] - line-length = 120 -+src = ["src"] -+extend-include = ["*.ipynb"] -+ -+[tool.ruff.format] -+docstring-code-format = true -+ -+[tool.ruff.lint] - select = [ - "F", # Errors detected by Pyflakes - "E", # Error detected by Pycodestyle -@@ -108,10 +111,10 @@ ignore = [ - "D213", - ] - --[tool.ruff.pydocstyle] -+[tool.ruff.lint.pydocstyle] - convention = "numpy" - --[tool.ruff.per-file-ignores] -+[tool.ruff.lint.per-file-ignores] - "docs/*" = ["I"] - "tests/*" = ["D"] - "*/__init__.py" = ["F401"]