Skip to content

Commit 7666a41

Browse files
committed
Merge branch 'main' of https://github.com/seedcase-project/template-python-package into refactor/do-not-use-reusable-workflows
2 parents bac189e + 9a7ab30 commit 7666a41

24 files changed

Lines changed: 367 additions & 158 deletions

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ repos:
2424
# sub-packages, which confuses pre-commit when it tries to find the latest
2525
# version
2626
- repo: https://github.com/adhtruong/mirrors-typos
27-
rev: v1.46.2
27+
rev: v1.46.3
2828
hooks:
2929
- id: typos
3030

3131
- repo: https://github.com/rvben/rumdl-pre-commit
32-
rev: v0.1.96
32+
rev: v0.2.0
3333
hooks:
3434
- id: rumdl-fmt # Auto-format

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ within each release.
2222
Commits from bots, like `dependabot` or `pre-commit-ci`, are not
2323
included in the changelog.
2424

25+
## [0.23.3](https://github.com/seedcase-project/template-python-package/compare/0.23.2..0.23.3) - 2026-06-01
26+
27+
### ♻️ Refactor
28+
29+
- Switch to using Cocogitto and git-cliff for releasing
30+
[#282](https://github.com/seedcase-project/template-python-package/pull/282)
31+
by [`@lwjohnst86`](https://github.com/lwjohnst86)
32+
([deea47b](https://github.com/seedcase-project/template-python-package/commit/deea47b97fa16d540f80a5695b60017793bdee98))
33+
34+
## [0.23.2](https://github.com/seedcase-project/template-python-package/compare/0.23.1..0.23.2) - 2026-05-22
35+
36+
### ♻️ Refactor
37+
38+
- Match changes from t-squared and from root folder
39+
[#287](https://github.com/seedcase-project/template-python-package/pull/287)
40+
by [`@lwjohnst86`](https://github.com/lwjohnst86)
41+
([317884a](https://github.com/seedcase-project/template-python-package/commit/317884a3486afc9d8aa7524039d3c1014babb9df))
42+
2543
## [0.23.1](https://github.com/seedcase-project/template-python-package/compare/0.23.0..0.23.1) - 2026-05-22
2644

2745
### ♻️ Refactor

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ When committing changes, please try to follow
5454
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
5555
as Git messages. Using this convention allows us to be able to
5656
automatically create a release based on the commit message by using
57-
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/).
57+
[Cocogitto](https://decisions.seedcase-project.org/why-semantic-release-with-cocogitto/).
5858
If you don't use Conventional Commits when making a commit, we will
5959
revise the pull request title to follow that format, as we use squash
6060
merges when merging pull requests, so all other commits in the pull

index.qmd

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ including for developing the package.
4343
- Uses [Quarto](https://quarto.org/) Markdown for the website content,
4444
allowing for easy integration of code, text, and figures.
4545
- 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/)
46+
[git-cliff](https://decisions.seedcase-project.org/why-changelog-with-git-cliff/)
47+
to automatically create the changelog.
48+
- Automates Git tagging and GitHub releases with
49+
[Cocogitto](https://decisions.seedcase-project.org/why-semantic-release-with-cocogitto/)
5250
that are based on messages following
5351
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/).
5452
- Uses a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)

template/.config/cliff.toml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
[remote]
2+
# Strictly don't connect to the internet to generate the changelog.
3+
offline = false
4+
5+
[remote.github]
6+
# TODO: Fill in the owner and repo so that the links in the changelog work correctly.
7+
owner = ""
8+
repo = ""
9+
10+
[changelog]
11+
# A Tera template to be rendered for each release in the changelog.
12+
header = """
13+
# Changelog
14+
15+
Since we follow
16+
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
17+
for commit messages, we can automatically create
18+
releases of the Python package based on those messages. The
19+
releases are also published to Zenodo for easier discovery, archiving,
20+
and citation.
21+
22+
We use
23+
[Cocogitto](https://decisions.seedcase-project.org/why-semantic-release-with-cocogitto/)
24+
to automate releases, which uses
25+
[SemVar](https://semverdoc.org) as the version numbering scheme,
26+
and [Git Cliff](https://decisions.seedcase-project.org/why-changelog-with-git-cliff/)
27+
to generate the changelog from commit messages.
28+
29+
Because releases are generated automatically, new versions are released
30+
often---sometimes several times in a day---
31+
and each release usually contains only a small number of changes. Below
32+
is a list of the releases and the changes
33+
within each one.
34+
35+
Commits from bots, like `dependabot` or `pre-commit-ci`, are not included in
36+
the changelog.
37+
"""
38+
39+
body = """
40+
{%- macro remote_url() -%}
41+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
42+
{%- endmacro -%}
43+
44+
{% macro print_commit(commit) -%}
45+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
46+
{% if commit.breaking %}**breaking** {% endif %}\
47+
{{ commit.message | upper_first }} \
48+
{% if commit.remote.username %} by \
49+
{% if commit.remote.username is containing("[bot]") %}
50+
`@{{ commit.remote.username }}`\
51+
{% else %}\
52+
[`@{{ commit.remote.username }}`](https://github.com/{{ commit.remote.username }})\
53+
{% endif %}\
54+
{% endif %} \
55+
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
56+
{% endmacro -%}
57+
58+
{% if version %}\
59+
{% if previous.version %}\
60+
## [{{ version | trim_start_matches(pat="v") }}]\
61+
({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
62+
{% else %}\
63+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
64+
{% endif %}\
65+
{% else %}\
66+
## [unreleased]
67+
{% endif %}\
68+
69+
{% for group, commits in commits | group_by(attribute="group") %}
70+
### {{ group | striptags | trim | upper_first }}
71+
{% for commit in commits
72+
| filter(attribute="scope")
73+
| sort(attribute="scope") %}
74+
{{ self::print_commit(commit=commit) }}
75+
{%- endfor %}
76+
{% for commit in commits %}
77+
{%- if not commit.scope -%}
78+
{{ self::print_commit(commit=commit) }}
79+
{% endif -%}
80+
{% endfor -%}
81+
{% endfor -%}
82+
83+
{%- if github -%}
84+
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
85+
### ❤️ New contributors
86+
{% endif %}\
87+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
88+
{% if contributor.username is containing("[bot]") %}
89+
- `@{{ contributor.username }}` started making automated contributions\
90+
{% else %}\
91+
- [`@{{ contributor.username }}`](https://github.com/{{ contributor.username }}) made their first contribution
92+
{%- if contributor.pr_number %} in \
93+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }})\
94+
{%- endif %}
95+
{%- endif %}\
96+
{%- endfor -%}
97+
{%- endif %}
98+
99+
"""
100+
101+
# Remove leading and trailing whitespaces from the changelog's body.
102+
trim = true
103+
output = "CHANGELOG.md"
104+
105+
[git]
106+
commit_preprocessors = [
107+
# TODO: Replace OWNER and REPO with actual owner and repo
108+
# Replace pull request numbers with links to GitHub.
109+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "[#${2}](https://github.com/OWNER/REPO/pull/${2})" },
110+
# Check spelling of the commit message using https://github.com/crate-ci/typos.
111+
# If the spelling is incorrect, it will be fixed automatically.
112+
{ pattern = '.*', replace_command = 'uvx typos --write-changes -' },
113+
# Remove gitmoji, both actual UTF emoji and :emoji:
114+
{ pattern = ' *(:\w+:|[\p{Emoji_Presentation}\p{Extended_Pictographic}](?:\u{FE0F})?\u{200D}?) *', replace = "" },
115+
]
116+
117+
commit_parsers = [
118+
# Don't include commits from bots.
119+
{ field = "author.name", pattern = ".*(dependabot|github-actions|pre-commit-ci).*", skip = true },
120+
# Don't include the version update commits.
121+
{ message = ".*update version", skip = true },
122+
{ message = "^feat", group = "<!-- 0 -->✨ Features" },
123+
{ message = "^fix", group = "<!-- 1 -->🐛 Fixes" },
124+
{ message = "^refactor", group = "<!-- 2 -->♻️ Refactor" },
125+
{ message = "^docs", group = "<!-- 3 -->📝 Documentation" },
126+
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
127+
{ message = "^style", group = "<!-- 5 -->💄 Style" },
128+
{ message = "^test", group = "<!-- 6 -->🧪 Tests" },
129+
{ message = "^ci", group = "<!-- 7 -->👷 CI/CD" },
130+
{ message = "^build", group = "<!-- 8 -->🧱 Build system" },
131+
{ message = "^chore", group = "<!-- 9 -->🧹 Chores" },
132+
{ message = "^revert", group = "<!-- 10 -->⏪ Revert" },
133+
{ message = ".*", skip = true },
134+
]

template/.config/cog.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from_latest_tag = true
2+
disable_changelog = true
3+
disable_bump_commit = true
4+
branch_whitelist = ["main"]
5+
pre_bump_hooks = [
6+
# Quiet the log output of git-cliff, it is noisy.
7+
"RUST_LOG='none' uvx git-cliff --tag {{version}}",
8+
"uvx rumdl fmt CHANGELOG.md --silent",
9+
"uv version {{version}}",
10+
"git commit CHANGELOG.md pyproject.toml uv.lock -m 'build: 🔖 update version to {{version}} [skip ci]'",
11+
]
12+
post_bump_hooks = ["git push", "git push --tags"]
13+
14+
[commit_types]
15+
refactor = { bump_patch = true }
16+
perf = { bump_patch = true }
17+
fix = { bump_patch = true }
18+
feat = { bump_minor = true }

template/.cz.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

template/.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ max_line_length = 88
1515
# Have a bit shorter line length for text docs
1616
[*.{txt,md,qmd}]
1717
max_line_length = 72
18-
indent_size = 4
1918

2019
# Python always uses 4 spaces for tabs
2120
[*.py]

template/.github/CODEOWNERS.jinja

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
# All members on Developers team get added to review PRs
2-
* {{ review_team }}
1+
# Which team or person to inform for PRs that modify these files.
2+
# `*` means all files in the repository.
3+
# TODO: Add code owners.
4+
*

template/.github/workflows/add-to-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
permissions: read-all
1616

1717
env:
18-
# TODO: Fill in with the correct board number for this repo.
18+
# TODO: Add the correct board number for this repo.
1919
BOARD_NUMBER: ""
2020

2121
jobs:

0 commit comments

Comments
 (0)