https://github.com/scverse/cookiecutter-scverse-presentation
Introduction to our template
https://github.com/scverse/cookiecutter-scverse-presentation
Last synced: 4 months ago
JSON representation
Introduction to our template
- Host: GitHub
- URL: https://github.com/scverse/cookiecutter-scverse-presentation
- Owner: scverse
- Created: 2024-09-06T07:57:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-22T18:03:18.000Z (6 months ago)
- Last Synced: 2025-12-24T06:43:38.640Z (6 months ago)
- Homepage: http://scverse.org/cookiecutter-scverse-presentation/
- Size: 191 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
marp: true
theme: uncover
paginate: true
#backgroundColor: #fff
backgroundImage: radial-gradient(circle 100vh at bottom 100px right 100px in hsl, var(--color-accent) 0%, transparent 100%)
style: |
:root {
--color-highlight: #0097a7;
--color-accent: rgb(161, 186, 182);
}
a:any-link {
--color-foreground: var(--color-highlight);
}
.columns {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 1rem;
}
---


# [scverse® cookiecutter template][template]
Follow along: [scverse.org/
cookiecutter-scverse-presentation][pres]
[template]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/template_usage.html
[pres]: https://scverse.org/cookiecutter-scverse-presentation/
---
## having impact with software
* Publish papers and get citations for academic success
* High quality software helps a lot with both
* Be part of the scverse ecosystem: ensure you meet minimum requirements for maximal impact
- Get reviewed by [PyOpenSci][]?
* Workshop goal: path to high quality software dev
[pyopensci]: https://www.pyopensci.org/
---
## scverse ecosystem
* Set of packages built around the scverse core packages
* Featured on the [scverse ecosystem][] website

[scverse ecosystem]: https://scverse.org/packages/#ecosystem
---
### scverse ecosystem requirements
* Metadata: name, description, OSI-approved license, ...
* Versioned releases installable from PyPI &/or Conda
* Tests automated via continuous integration (CI)
* Docs for API and use-cases
* Scverse datastructures used where appropriate
---
### how to get into the scverse ecosystem
Instructions to add your package are on the [scverse ecosystem repository][]
- Submit existing package, or
- Easiest way: [scverse cookiecutter template][]
[scverse ecosystem repository]: https://github.com/scverse/ecosystem-packages
[scverse cookiecutter template]: https://github.com/scverse/cookiecutter-scverse
---
## scverse cookiecutter template
* Project template for scverse packages¹
* Best practice structure
* Many features such as continuous integration, documentation setup, …
* Automatically ticks all scverse ecosystem requirements
¹Much is applicable elsewhere
---
# steps
1. Set up global environment to create project
2. Create project using [scverse cookiecutter template][]
3. Set up project specific development environment
4. Develop your package
5. Submit to [scverse ecosystem][]
---
## step 1: global environment
* Install using a package manager or installer:
- [`code`][], [`hatch`][], & [`git`][]
- [`uv`][] or [`pipx`][]
* Install using a package manager, `pipx`, or `uv`:
- `cruft` & `pre-commit`
```console
$ pipx install cruft pre-commit # or
$ uv tool install cruft pre-commit
```
[`code`]: https://code.visualstudio.com/download
[`hatch`]: https://hatch.pypa.io/latest/install/
[`git`]: https://github.com/git-guides/install-git
[`uv`]: https://docs.astral.sh/uv/getting-started/installation/
[`pipx`]: https://pipx.pypa.io/stable/installation/
---
## step 2: creating the project
```console
$ cruft create https://github.com/scverse/cookiecutter-scverse
project_name (project-name): myproj
[…]
$ code myproj
```

---
## step 3: environment management
Hatch envs [basic usage][hatch envs]:
```console
$ hatch run [env:]command [...args] # e.g. `… docs:build -T`
$ hatch test [...args]
$ hatch env remove # or `hatch env prune` for all
$ hatch env find hatch-test
~/.local/share/hatch/env/virtual/myproj/FsejNibV/hatch-test.py3.12
[…]
```
Make sure it exists, then tell VS Code:
⌘|^+⇑+P → Python: Select Interpreter
[hatch envs]: https://hatch.pypa.io/latest/tutorials/environment/basic-usage/
---
### running tests
```console
$ hatch test --help
[…]
Options:
-r, --randomize
-p, --parallel
-c, --cover
-a, --all
-py, --python=X.Y
-i, --include=VAR=VAL
-x, --exclude=VAR=VAL
-s, --show
…otherwise same as `pytest`
```

---
### building docs
```console
$ hatch run docs:build
$ hatch run docs:open
$ hatch run docs:clean
```
See pyproject.toml:
```toml
[tools.hatch.envs.docs]
scripts.build = "..."
...
```

---
### formatting and linting
VS Code:
```json
{
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": { ... },
}, ...
}
```
CLI: `pre-commit` (or `hatch run pre-commit`)
```console
$ pre-commit install # `git commit` hook
$ pre-commit run --all-files
```
---
### existing project
* Simple project
1. Instantiate template
2. Replace src/* directory with your package
3. Edit `[project]` table in pyproject.toml
* Complex project
1. Step by step PRs: formatter, …
2. We can help!
---
# follow along
---
## step 4: committing code
- Use PRs, don’t push to `main`
- Set up [pre-commit.ci][], [codecov.io][] on
github.com/<you>/<yourpackage>/settings/installations

[pre-commit.ci]: https://pre-commit.ci/
[codecov.io]: https://codecov.io/
---
### ReadTheDocs
- Set up [readthedocs.org][] and its [PR previews][]:

[readthedocs.org]: https://docs.readthedocs.io/en/stable/intro/import-guide.html
[PR previews]: https://docs.readthedocs.io/en/stable/guides/pull-requests.html
---
## step 5: submit to scverse ecosystem
1) Follow the [instructions][scverse ecosystem repository]
2) Submit a pull request
3) Maybe get reviewed by [PyOpenSci][]

---
# Thank You!