Skip to content

Commit 3722ef1

Browse files
Update instance repo from cookiecutter template
1 parent e9e4181 commit 3722ef1

2 files changed

Lines changed: 22 additions & 27 deletions

File tree

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
3-
"commit": "cbf6b45007d28c0cf4faf528f99f46b53565a92f",
3+
"commit": "a269fb4b9cf3558fcc3ea625409e5319f5dc3526",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -36,7 +36,7 @@
3636
"trim_blocks": true
3737
},
3838
"_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse",
39-
"_commit": "cbf6b45007d28c0cf4faf528f99f46b53565a92f"
39+
"_commit": "a269fb4b9cf3558fcc3ea625409e5319f5dc3526"
4040
}
4141
},
4242
"directory": null

docs/template_usage.md

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Welcome to the developer guidelines! This document is split into two parts:
77
2. The [contributor guide](contributing.md#contributing-guide).
88
It contains information relevant to all developers who want to make a contribution.
99

10-
## Setting up the repository
11-
12-
### First commit
10+
## First commit
1311

1412
If you are reading this, you should have just completed the repository creation with:
1513

@@ -47,22 +45,22 @@ While the repository at this point can be directly used, there are few remaining
4745

4846
[github quickstart guide]: https://docs.github.com/en/get-started/quickstart/create-a-repo?tool=webui
4947

50-
### The pyproject.toml file
48+
## The pyproject.toml file
5149

5250
Modern Python package management uses a `pyproject.toml` that was first introduced in [PEP 518](https://peps.python.org/pep-0518/).
5351
This file contains build system requirements and information, which are used by pip to build the package, and tool configurations.
5452
For more details please have a look at [pip's description of the pyproject.toml file](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/).
5553
It also serves as a single point of truth to define test environments and how docs are built by leveraging
5654
the [hatch][] project manager, but more about that in the [contributing guide](contributing.md).
5755

58-
#### Important metadata fields
56+
### Important metadata fields
5957

6058
The `[project]` section in the `pyproject.toml` file defines several important metadata fields that might require editing.
6159
For example, the `name`, `description`, `authors` fields could need updates as the project evolves.
6260
Especially, the `version` field needs to be adapted if newer versions of the package are to be released.
6361
See {ref}`vcs-based-versioning` for more details.
6462

65-
#### Dependency management
63+
### Dependency management
6664

6765
Package dependencies can be added to the `dependencies` of the `[project]` section.
6866
You can constrain versions using any of `>=`, `>`, `<`, `<=`, `==`, `!=`, and `~=`.
@@ -72,7 +70,7 @@ As another example, if there is a known buggy version, you could exclude it like
7270
Further optional dependencies are defined in the `[project.optional-dependencies]` section such as dependencies only for tests (`test`).
7371
All dependencies listed in such optional dependency groups can then be installed by specifying them like: `pip install <package-name>[test]`.
7472

75-
#### Tool configurations
73+
### Tool configurations
7674

7775
The `pyproject.toml` file also serves as single configuration file for many tools such as many {ref}`pre-commit`.
7876
For example, the line length for auto-formatting can be configured as follows:
@@ -84,7 +82,7 @@ line-length = 120
8482

8583
[hatch]: https://hatch.pypa.io/latest/
8684

87-
### Coverage tests with _Codecov_
85+
## Coverage tests with _Codecov_
8886

8987
Coverage tells what fraction of the code is "covered" by unit tests,
9088
thereby encouraging contributors to [write tests](contributing.md#writing-tests).
@@ -102,7 +100,7 @@ To set it up, simply go to the [codecov app][] page and follow the instructions
102100
[codecov docs]: https://docs.codecov.com/docs
103101
[OpenID connect]: https://docs.github.com/en/actions/concepts/security/openid-connect
104102

105-
### Documentation on _readthedocs_
103+
## Documentation on _readthedocs_
106104

107105
We recommend using [readthedocs.org][] (RTD) to build and host the documentation for your project.
108106
To enable readthedocs, head over to [their website][readthedocs.org] and sign in with your GitHub account.
@@ -123,7 +121,7 @@ See a guide [here](https://docs.readthedocs.io/en/stable/guides/importing-privat
123121

124122
(github-actions)=
125123

126-
### Github Actions
124+
## Github Actions
127125

128126
[GitHub Actions][] is a continuous integration (CI)/continuous development (CD) automation tool that enables workflows for building, testing, and deploying code directly from a GitHub repository.
129127
It uses YAML-based configuration files to define jobs and steps, which can be triggered by events like pushes, pull requests, or scheduled runs.
@@ -148,7 +146,7 @@ There you can see the execution history, logs, and (re-)trigger workflows manual
148146
(automating-pypi-released-using-github-actions)=
149147
(configuring-the-github-workflow)=
150148

151-
### Automating the PyPI release using GitHub actions
149+
## Automating the PyPI release using GitHub actions
152150

153151
Tags adhering to `"*.*.*"` that are pushed to the `main` branch will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][].
154152

@@ -170,15 +168,15 @@ For more details, please refer to the official [PyPI guide for setting up truste
170168

171169
(pre-commit)=
172170

173-
### Pre-commit checks
171+
## Pre-commit checks
174172

175173
[Pre-commit][] checks are fast programs that check code for errors, inconsistencies and code styles, before the code is committed.
176174

177175
This template uses a number of pre-commit checks.
178176
In this section we'll detail what is used, where they're defined, and how to modify these checks.
179177

180178

181-
#### Pre-commit CI
179+
### Pre-commit CI
182180

183181
We recommend setting up [pre-commit.ci][] to enforce consistency checks on every commit and pull-request.
184182

@@ -189,7 +187,7 @@ You may choose to enable the service for an entire organization or on a per-repo
189187
Once authorized, pre-commit.ci should automatically be activated.
190188

191189

192-
#### Overview of pre-commit hooks used by the template
190+
### Overview of pre-commit hooks used by the template
193191

194192
The following pre-commit hooks are for code style and format:
195193

@@ -230,19 +228,19 @@ The following pre-commit hooks are for errors and inconsistencies:
230228
- [Ruff-specific rules](https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf) (rule category: `RUF`):
231229
- `RUF100`: remove unnecessary `# noqa` comments ()
232230

233-
#### How to add or remove pre-commit checks
231+
### How to add or remove pre-commit checks
234232

235233
The [pre-commit checks](#pre-commit-checks) check for both correctness and stylistic errors.
236234
In some cases it might overshoot and you may have good reasons to ignore certain warnings.
237235
This section shows you where these checks are defined, and how to enable/ disable them.
238236

239-
##### pre-commit
237+
#### pre-commit
240238

241239
You can add or remove pre-commit checks by simply deleting relevant lines in the `.pre-commit-config.yaml` file under the repository root.
242240
Some pre-commit checks have additional options that can be specified either in the `pyproject.toml` (for [ruff][]) or tool-specific config files,
243241
such as `biome.jsonc` for [biome][].
244242

245-
##### Ruff
243+
#### Ruff
246244

247245
This template configures `ruff` through the `[tool.ruff]` entry in the `pyproject.toml`.
248246
For further information `ruff` configuration, see [the docs][ruff-config].
@@ -305,7 +303,7 @@ add it to Ruff’s [`external = [...]`][ruff-external] setting to prevent `RUF10
305303
[ruff-external]: https://docs.astral.sh/ruff/settings/#external
306304

307305

308-
### API design
306+
## API design
309307

310308
Scverse ecosystem packages should operate on [AnnData][], [MuData][], and/or [SpatialData][] data structures and typically use an API
311309
as originally [introduced by scanpy][scanpy-api] with the following submodules:
@@ -325,7 +323,7 @@ there may also be good reasons to choose a different approach, e.g. using an obj
325323

326324
(vcs-based-versioning)=
327325

328-
### Using VCS-based versioning
326+
## Using VCS-based versioning
329327

330328
By default, the template uses hard-coded version numbers that are set in `pyproject.toml`.
331329
If you prefer to have your project automatically infer version numbers from git tags,
@@ -361,7 +359,7 @@ Don't forget to update the [Making a release section](contributing.md#publishing
361359

362360
[hatch-vcs]: https://pypi.org/project/hatch-vcs/
363361

364-
### Automated template sync
362+
## Automated template sync
365363

366364
Automated template sync is enabled by default for public repositories on GitHub.
367365
Our [scverse-bot][] automatically crawls GitHub for repositories that are based on this template,
@@ -384,9 +382,6 @@ The following hints may be useful to work with the template sync:
384382

385383
:::
386384

387-
388-
:::
389-
390385
[list of template repositories]: https://github.com/scverse/ecosystem-packages/blob/main/template-repos.yml
391386
[scverse-bot]: https://github.com/scverse-bot
392387

@@ -408,7 +403,7 @@ Here's one way how to do it:
408403

409404
```bash
410405
mkdir template && cd template
411-
cruft create https://github.com/scverse/cookiecutter-scverse
406+
uvx --with pre-commit cruft create https://github.com/scverse/cookiecutter-scverse
412407
```
413408

414409
4. remove everything from the existing repo
@@ -425,7 +420,7 @@ Here's one way how to do it:
425420

426421
```bash
427422
# move everything, including hidden folders, excluding `.git`.
428-
rsync -av --exclude='.git' ../template/$REPO ./
423+
rsync -av --exclude='.git' ../template/$REPO/ ./
429424
git add -A
430425
git commit -m "init from template"
431426
```

0 commit comments

Comments
 (0)