Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
"commit": "be7aa668a1f275bf9555e048fb2a3e2a02704778",
"commit": "a9da0ae1e14597665ffa6408828e30ad630c0fdf",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"trim_blocks": true
},
"_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
"_commit": "be7aa668a1f275bf9555e048fb2a3e2a02704778"
"_commit": "a9da0ae1e14597665ffa6408828e30ad630c0fdf"
}
},
"directory": null
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autofix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Run pre-commit hooks
run: uvx prek run --all-files --show-diff-on-failure --color=always
- uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4
if: '!cancelled()'
if: "!cancelled()"
12 changes: 6 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
test:
needs: get-environments
permissions:
id-token: write # for codecov OIDC
contents: read
id-token: write # for codecov OIDC
contents: read

strategy:
fail-fast: false
Expand All @@ -63,7 +63,7 @@ jobs:

name: ${{ matrix.env.label }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
env:
UV_PYTHON: ${{ matrix.env.python }}

Expand Down Expand Up @@ -102,6 +102,6 @@ jobs:
- test
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ default_stages:
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/biomejs/pre-commit
rev: v2.5.11
rev: v2.6.3
hooks:
- id: biome-format
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
groups: [format]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.29.2
rev: v2.30.3
hooks:
- id: pyproject-fmt
groups: [format]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.5
rev: v0.17.2
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -43,7 +43,7 @@ repos:
- id: end-of-file-fixer
groups: [format]
- id: mixed-line-ending
exclude: ^\.cruft\.json$ # inconsistent file endings on windows - file never to be modified manually.
exclude: ^\.cruft\.json$ # inconsistent file endings on windows - file never to be modified manually.
args: [--fix=lf]
groups: [format]
- id: trailing-whitespace
Expand All @@ -54,7 +54,7 @@ repos:
args: [--assume-in-merge]

- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.30.0
rev: v1.31.1
hooks:
- id: zizmor
args: [--no-progress, --fix]
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"$schema": "https://biomejs.dev/schemas/2.6.3/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": { "useEditorconfig": true },
"overrides": [
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the [scientific Python tutorials][], or the [scanpy developer guide][].
[scientific Python tutorials]: https://learn.scientific-python.org/development/tutorials/
[scanpy developer guide]: https://scanpy.scverse.org/page/dev/

:::{tip} The *hatch* project manager
:::{tip} The _hatch_ project manager

We highly recommend to familiarize yourself with [`hatch`][hatch].
Hatch is a Python project manager that
Expand Down
89 changes: 44 additions & 45 deletions docs/template_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ To set this up, login to [PyPI][], and proceed depending on whether you already
- If yes, navigate to the project. In the left sidebar, choose "Publishing", then proceed to add the repository details.
- If not, go to your [PyPI publishing settings][] and fill out the “Add a new pending publisher” form.

Enter everything *exactly* as it is displayed on GitHub (i.e. use the correct casing for your repository name).
Enter everything _exactly_ as it is displayed on GitHub (i.e. use the correct casing for your repository name).
The "Workflow name" needs to bet set to `release.yaml`.
Set "Environment name" to “pypi” to match `environment: pypi` in `.github/workflows/release.yaml`.
For more details, please refer to the official [PyPI guide for setting up trusted publishing][trusted publisher].
Expand All @@ -182,7 +182,6 @@ the project will be published only once you release your package for the first t

[github-releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
[pypi-trusted-publishing-guide]: https://docs.pypi.org/trusted-publishers/adding-a-publisher/

[PyPI]: https://pypi.org/
[PyPI publishing settings]: https://pypi.org/manage/account/publishing/
[trusted publisher]: https://docs.pypi.org/trusted-publishers/
Expand Down Expand Up @@ -218,38 +217,38 @@ The following pre-commit hooks are for code style and format:
code formatter for non-Python files (e.g. JSON).
- [ruff][] formatting (`ruff-format`) which implements all rules of the also widely used [Black formatter](https://github.com/psf/black)
- [ruff][] based checks:
- [isort](https://beta.ruff.rs/docs/rules/#isort-i) (rule category: `I`):
sort module imports into sections and types.
- [pydocstyle](https://beta.ruff.rs/docs/rules/#pydocstyle-d) (rule category: `D`):
pydocstyle extension of flake8.
- [flake8-tidy-imports](https://beta.ruff.rs/docs/rules/#flake8-tidy-imports-tid) (rule category: `TID`):
tidy module imports.
- [flake8-comprehensions](https://beta.ruff.rs/docs/rules/#flake8-comprehensions-c4) (rule category: `C4`):
write better list/set/dict comprehensions.
- [pyupgrade](https://beta.ruff.rs/docs/rules/#pyupgrade-up) (rule category: `UP`):
upgrade syntax for newer versions of the language.
- [isort](https://beta.ruff.rs/docs/rules/#isort-i) (rule category: `I`):
sort module imports into sections and types.
- [pydocstyle](https://beta.ruff.rs/docs/rules/#pydocstyle-d) (rule category: `D`):
pydocstyle extension of flake8.
- [flake8-tidy-imports](https://beta.ruff.rs/docs/rules/#flake8-tidy-imports-tid) (rule category: `TID`):
tidy module imports.
- [flake8-comprehensions](https://beta.ruff.rs/docs/rules/#flake8-comprehensions-c4) (rule category: `C4`):
write better list/set/dict comprehensions.
- [pyupgrade](https://beta.ruff.rs/docs/rules/#pyupgrade-up) (rule category: `UP`):
upgrade syntax for newer versions of the language.
- [pyproject-fmt][] formats the `pyproject.toml` file in a consistent way.

The following pre-commit hooks are for errors and inconsistencies:

- [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks): generic pre-commit hooks for text files.
- **detect-private-key**: checks for the existence of private keys.
- **check-ast**: check whether files parse as valid python.
- **end-of-file-fixer**: check files end in a newline and only a newline.
- **mixed-line-ending**: checks mixed line ending.
- **trailing-whitespace**: trims trailing whitespace.
- **check-case-conflict**: check files that would conflict with case-insensitive file systems.
- **detect-private-key**: checks for the existence of private keys.
- **check-ast**: check whether files parse as valid python.
- **end-of-file-fixer**: check files end in a newline and only a newline.
- **mixed-line-ending**: checks mixed line ending.
- **trailing-whitespace**: trims trailing whitespace.
- **check-case-conflict**: check files that would conflict with case-insensitive file systems.
- [ruff][] based checks:
- [pyflakes](https://beta.ruff.rs/docs/rules/#pyflakes-f) (rule category: `F`):
various checks for errors.
- [pycodestyle](https://beta.ruff.rs/docs/rules/#pycodestyle-e-w) (rule category: `E`, `W`):
various checks for errors.
- [flake8-bugbear](https://beta.ruff.rs/docs/rules/#flake8-bugbear-b) (rule category: `B`):
find possible bugs and design issues in program.
- [flake8-blind-except](https://beta.ruff.rs/docs/rules/#flake8-blind-except-ble) (rule category: `BLE`):
checks for blind, catch-all `except` statements.
- [Ruff-specific rules](https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf) (rule category: `RUF`):
- `RUF100`: remove unnecessary `# noqa` comments ()
- [pyflakes](https://beta.ruff.rs/docs/rules/#pyflakes-f) (rule category: `F`):
various checks for errors.
- [pycodestyle](https://beta.ruff.rs/docs/rules/#pycodestyle-e-w) (rule category: `E`, `W`):
various checks for errors.
- [flake8-bugbear](https://beta.ruff.rs/docs/rules/#flake8-bugbear-b) (rule category: `B`):
find possible bugs and design issues in program.
- [flake8-blind-except](https://beta.ruff.rs/docs/rules/#flake8-blind-except-ble) (rule category: `BLE`):
checks for blind, catch-all `except` statements.
- [Ruff-specific rules](https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf) (rule category: `RUF`):
- `RUF100`: remove unnecessary `# noqa` comments ()
- [mypy][]:
static type checker that verifies the type annotations of the package under `src/` and the `tests/`.

Expand Down Expand Up @@ -456,29 +455,29 @@ Here's one way how to do it:
2. Clone your repository a second time to `${REPO}_cookiecutterized`
3. Initialize an empty repository from this cookiecutter template:

```bash
mkdir template && cd template
uvx --with prek cruft create https://github.com/scverse/cookiecutter-scverse
```
```bash
mkdir template && cd template
uvx --with prek cruft create https://github.com/scverse/cookiecutter-scverse
```

4. remove everything from the existing repo

```bash
cd ${REPO}_cookiecutterized
git switch -c cookiecutterize
git rm -r "*"
git add -A
git commit -m "clean repo"
```
```bash
cd ${REPO}_cookiecutterized
git switch -c cookiecutterize
git rm -r "*"
git add -A
git commit -m "clean repo"
```

5. move template over from generated folder

```bash
# move everything, including hidden folders, excluding `.git`.
rsync -av --exclude='.git' ../template/$REPO/ ./
git add -A
git commit -m "init from template"
```
```bash
# move everything, including hidden folders, excluding `.git`.
rsync -av --exclude='.git' ../template/$REPO/ ./
git add -A
git commit -m "init from template"
```

6. Migrate your project: Move over files from `$REPO` to `${REPO}_cookiecutterized`.
Omit files that are not needed anymore and manually merge files where required.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Typing :: Typed",
]
dependencies = [
Expand Down
Loading