Skip to content

Commit cca007d

Browse files
docs: 📝 apply suggestions from code review
Co-authored-by: Luke W. Johnston <lwjohnst86@users.noreply.github.com>
1 parent 2cbd5bf commit cca007d

4 files changed

Lines changed: 92 additions & 22 deletions

File tree

CITATION.cff

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: "Template Python package: An opinionated setup for making Python packages."
1+
title: "Template Python Package: An opinionated setup for making Python packages"
22
abstract: "A template for making a Git repository that follows strongly opinionated practices for building and managing Python packages."
33
authors:
44
- family-names: Johnston
@@ -12,11 +12,13 @@ authors:
1212
- family-names: Beicher
1313
given-names: Kristiane
1414
affiliation: "Steno Diabetes Center Aarhus"
15+
orcid: "https://orcid.org/0000-0001-7556-9566"
1516
- family-names: Vago
1617
given-names: Marton
1718
affiliation: "Steno Diabetes Center Aarhus"
1819
cff-version: 1.2.0
1920
# doi:
21+
# date:
2022
keywords:
2123
- "copier template"
2224
- "template"

CONTRIBUTING.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ justfile to manage our project, such as to run checks and test the
2121
template. Both the uv and justfile websites have a more detailed guide
2222
on using uv, but below are some simple instructions to get you started.
2323

24-
To install uv and justfile, run:
24+
It's easiest to install uv and justfile using
25+
[pipx](https://pypa.github.io/pipx/), so install that first. Then,
26+
install uv and justfile by running:
2527

2628
``` bash
2729
pipx install uv rust-just
@@ -47,3 +49,14 @@ When testing the template, copier can only use content kept in the Git
4749
history. Meaning that if you make changes to the template and try to
4850
test it, it won't be able to test those changes. You have to commit the
4951
changes first in order for copier to use them.
52+
53+
When committing changes, please try to follow [Conventional
54+
Commits](https://decisions.seedcase-project.org/why-conventional-commits)
55+
as Git messages. Using this convention allows us to be able to
56+
automatically create a release based on the commit message by using
57+
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen).
58+
If you don't use Conventional Commits when making a commit, we will
59+
revise the pull request title to follow that format, as we use [squash
60+
merges](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/squashing-commits/about-squash-merges)
61+
when merging pull requests, so all other commits in the pull request
62+
will be squashed into one commit.

docs/guide.qmd

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,29 @@ repository with the settings we use, but you can follow them if you want
119119
to set up your Python package in a similar way. They are also included
120120
in a message after you've copied the template.
121121

122-
After copying the template, while in the directory of the new Data
123-
Package, run the following:
122+
After copying the template, while in the directory of the new Python
123+
package, run the following:
124124

125125
``` bash
126126
just install-precommit
127127
```
128128

129+
This sets up the pre-commit hooks to run standard checks on your
130+
repository whenever you commit files to the history.
131+
132+
If you are using the template to create a Python package for the Seedcase
133+
Project, run:
134+
135+
``` bash
136+
just update-quarto-theme
137+
```
138+
139+
This adds the `seedcase-theme` Quarto theme to the website, which
140+
provides a consistent look and feel across all Seedcase Project
141+
websites, including for Python package websites.
142+
It's called `update-quarto-theme` here since you can use this
143+
command to keep the theme updated.
144+
129145
Next, install [`spaid`](https://github.com/seedcase-project/spaid) and
130146
use the following commands to run the next setup steps:
131147

@@ -136,14 +152,26 @@ spaid_gh_ruleset_basic_protect_main -h
136152
```
137153

138154
Some configuration is needed after copying this template to a new
139-
repository, including configuration external to the repository.
140-
141-
- The template file `.github/workflows/release-package.yml` requires
142-
the [auto-release-token](https://github.com/apps/auto-release-token)
143-
GitHub App to be installed.
144-
- The GitHub secrets `UPDATE_VERSION_TOKEN`, `ADD_TO_BOARD`, and
145-
`NETLIFY_AUTH_TOKEN` and variables `UPDATE_VERSION_APP_ID` and
146-
`ADD_TO_BOARD_APP_ID` have to be set up in the repository (or
147-
organization) settings. See this
148-
[guide](https://guidebook.seedcase-project.org/operations/security#using-github-apps-to-generate-tokens)
149-
for more details on how to configure this.
155+
repository, including configuration external to the repository. Some
156+
GitHub workflows require installing GitHub Apps, for greater security
157+
purposes and easier administration when managing multiple repositories.
158+
The [security
159+
section](https://guidebook.seedcase-project.org/operations/security#using-github-apps-to-generate-tokens)
160+
in our [Guidebook](https://guidebook.seedcase-project.org/) provides
161+
instructions on how to set up GitHub Apps, secrets, and variables.
162+
Ideally the secrets and variables should be set up in the organization
163+
settings. The specific workflows in this template that require this
164+
additional setup are:
165+
166+
- The workflow `.github/workflows/release-package.yml` requires the
167+
[auto-release-token](https://github.com/apps/auto-release-token)
168+
GitHub App as well as a creating a GitHub secret called
169+
`UPDATE_VERSION_TOKEN` and a variable called `UPDATE_VERSION_APP_ID`
170+
that has the App ID.
171+
- The workflow `.github/workflows/add-to-project.yml` requires the
172+
[add-to-board-token](https://github.com/apps/add-to-board-token)
173+
GitHub App, along with the `ADD_TO_BOARD_TOKEN` secret and the
174+
`ADD_TO_BOARD_APP_ID` variable of the GitHub App's ID.
175+
176+
If you use Netlify, you will also need to add a `NETLIFY_AUTH_TOKEN` secret
177+
of your Netlify Token.

index.qmd

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,53 @@ including for developing the package.
1212
## Features
1313

1414
- Use [uv](https://decisions.seedcase-project.org/why-uv/) to manage
15-
the Python package.
16-
- Build management with [just](https://just.systems/man/en/).
17-
- Check typos with [typos](https://github.com/crate-ci/typos).
15+
the Python package and for project management.
16+
- Includes a [justfile](https://just.systems/man/en/) for managing
17+
common tasks like building the website and running checks.
18+
- Uses [typos](https://github.com/crate-ci/typos) to check for common
19+
spelling mistakes.
1820
- Code formatting and linting with
1921
[ruff](https://decisions.seedcase-project.org/why-ruff/).
20-
- Pre-commit hooks with [pre-commit](https://pre-commit.com/).
22+
- Run checks with [pre-commit](https://pre-commit.com/) hooks to
23+
ensure consistent formatting and style across the project. It
24+
includes checks for credentials, typos, and file formatting.
2125
- GitHub workflows for automatically adding Pull Requests and Issues
2226
to a project board.
2327
- Pull Request template for easy creation of new Pull Requests.
28+
- Includes [GitHub Actions](https://docs.github.com/en/actions) for
29+
continuous integration, testing, and delivery for running checks,
30+
formatting, releasing, and building the Python package and associated
31+
documentation.
32+
- Pull Request template for easy creation of new Pull Requests.
2433
- [VS Code](https://code.visualstudio.com/) settings commonly used by
2534
contributors working in VS Code.
26-
- [EditorConfig](https://editorconfig.org/) for common cross-editor
27-
settings for contributors.
35+
- Includes an [EditorConfig](https://editorconfig.org/) file to ensure
36+
consistent formatting across different editors.
2837
- [`CITATION.cff`](https://citation-file-format.github.io/) file for
2938
citation information.
30-
- Website generation with [Quarto](https://quarto.org/).
3139
- Python package folder and file structure that takes advantage of
3240
Python's packaging ecosystem.
3341
- [`pyproject.toml`](https://peps.python.org/pep-0518/) for tracking
3442
dependencies and project metadata.
43+
- Uses [Quarto](https://quarto.org/) Markdown for the website content,
44+
allowing for easy integration of code, text, and figures.
45+
- Uses
46+
[Commitizen](https://decisions.seedcase-project.org/why-changelog-with-commitizen)
47+
to
48+
[check](https://decisions.seedcase-project.org/why-lint-with-commitizen/)
49+
commit messages and automatically create the changelog.
50+
- Automated Git tagging and GitHub releases with
51+
[commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/)
52+
that are based on messages following [Conventional
53+
Commits](https://decisions.seedcase-project.org/why-conventional-commits).
54+
- Uses a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)
55+
license for the website content.
56+
- Uses an [MIT](https://decisions.seedcase-project.org/why-mit-license/index.html)
57+
license for the code.
58+
- Optionally uses the
59+
[`seedcase-theme`](https://github.com/{{< meta gh.org >}}/seedcase-theme)
60+
Quarto extension for a standard appearance across websites.
61+
- Uses [Netlify](https://www.netlify.com/) for hosting the website.
3562

3663
## Want to contribute?
3764

0 commit comments

Comments
 (0)