Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# EditorConfig settings. Some editors will read these automatically;
# for those that don't, see here: http://editorconfig.org/
# for those that don't, see here: https://editorconfig.org/

root = true

Expand Down
2 changes: 1 addition & 1 deletion 404.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Let's get you back to greener grounds.

![](/_extensions/seedcase-project/seedcase-theme/images/404.svg){fig-alt="An illustration of the number 404 surrounded by trees and mountains"}

## Illustration by [Storyset](https://storyset.com/web) {.appendix}
## Illustration by [Storyset](https://storyset.com/online) {.appendix}
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Changelog

Since we follow
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits)
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
when writing commit messages, we're able to automatically create formal
"releases" of the template based on the commit messages. Releases in the
context of template are when changes occur to the `template/` files or
to the `copier.yaml` files. The releases are also published to Zenodo
for easier discovery, archival, and citation purposes. We use
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen)
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/)
to be able to automatically create these releases, which uses
[SemVar](https://semverdoc.org) as the version numbering scheme.

Expand Down
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ be reported by opening an issue or contacting one or more of the project
maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(<https://contributor-covenant.org>), version 1.0.0, available at
<https://contributor-covenant.org/version/1/0/0/>
(<https://www.contributor-covenant.org>), version 1.0.0, available at
<https://www.contributor-covenant.org/version/1/0/0/>
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ template. Both the uv and justfile websites have a more detailed guide
on using uv, but below are some simple instructions to get you started.

It's easiest to install uv and justfile using
[pipx](https://pypa.github.io/pipx/), so install that first. Then,
[pipx](https://pipx.pypa.io/stable/), so install that first. Then,
install uv and justfile by running:

``` bash
Expand Down Expand Up @@ -52,12 +52,12 @@ test it, it won't be able to test those changes. You have to commit the
changes first in order for copier to use them.

When committing changes, please try to follow
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits)
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
as Git messages. Using this convention allows us to be able to
automatically create a release based on the commit message by using
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen).
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/).
If you don't use Conventional Commits when making a commit, we will
revise the pull request title to follow that format, as we use
[squash merges](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/squashing-commits/about-squash-merges)
when merging pull requests, so all other commits in the pull request
will be squashed into one commit.
[squash merges](https://git-scm.com/docs/git-merge) when merging pull
requests, when merging pull requests, so all other commits in the pull
request will be squashed into one commit.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ status](https://results.pre-commit.ci/badge/github/seedcase-project/template-pyt
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)

This repository contains a [copier](https://copier.readthedocs.io/)
template for setting up a new repository for a Python package. Along
with a structured directory layout, this template includes
configurations for tools that improve developer experience, continuous
integration and delivery workflows, and supporting files for building
robust Python packages.
This repository contains a
[copier](https://copier.readthedocs.io/en/stable/) template for setting
up a new repository for a Python package. Along with a structured
directory layout, this template includes configurations for tools that
improve developer experience, continuous integration and delivery
workflows, and supporting files for building robust Python packages.

Check out our
[website](https://template-python-package.seedcase-project.org) for more
information, such as the features it provides and a
[guide](https://template-python-package.seedcase-project.org/docs/guide/)
[guide](https://template-python-package.seedcase-project.org/docs/guide)
to using the template. For a list of changes, see our
[changelog](https://template-python-package.seedcase-project.org/docs/releases/)
[changelog](https://template-python-package.seedcase-project.org/changelog.html)
page.

## Contributing

Check out our [contributing
page](https://template-python-package.seedcase-project.org/contributing/)
page](https://template-python-package.seedcase-project.org/contributing)
for information on how to contribute to the project, including how to
set up your development environment.

Expand All @@ -52,7 +52,8 @@ requests :tada:

[@lwjohnst86](https://github.com/lwjohnst86),
[@martonvago](https://github.com/martonvago),
[@signekb](https://github.com/signekb)
[@signekb](https://github.com/signekb),
[@joelostblom](https://github.com/joelostblom)

## Licensing

Expand Down
20 changes: 10 additions & 10 deletions README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ metadata-files:

{{< include /docs/includes/_badges.qmd >}}

This repository contains a [copier](https://copier.readthedocs.io/)
template for setting up a new repository for a Python package. Along
with a structured directory layout, this template includes
configurations for tools that improve developer experience, continuous
integration and delivery workflows, and supporting files for building
robust Python packages.
This repository contains a
[copier](https://copier.readthedocs.io/en/stable/) template for setting
up a new repository for a Python package. Along with a structured
directory layout, this template includes configurations for tools that
improve developer experience, continuous integration and delivery
workflows, and supporting files for building robust Python packages.

Check out our [website]({{< meta links.site >}}) for more information,
such as the features it provides and a
[guide]({{< meta links.site >}}/docs/guide/) to using the template. For
a list of changes, see our
[changelog]({{< meta links.site >}}/docs/releases/) page.
[guide]({{< meta links.site >}}/docs/guide) to using the template. For a
list of changes, see our
[changelog]({{< meta links.site >}}/changelog.html) page.

## Contributing

Check out our [contributing page]({{< meta links.site >}}/contributing/)
Check out our [contributing page]({{< meta links.site >}}/contributing)
for information on how to contribute to the project, including how to
set up your development environment.

Expand Down
2 changes: 1 addition & 1 deletion docs/includes/_contributors.qmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The following people have contributed to this project by submitting pull requests :tada:

[\@lwjohnst86](https://github.com/lwjohnst86), [\@martonvago](https://github.com/martonvago), [\@signekb](https://github.com/signekb)
[\@lwjohnst86](https://github.com/lwjohnst86), [\@martonvago](https://github.com/martonvago), [\@signekb](https://github.com/signekb), [\@joelostblom](https://github.com/joelostblom)
10 changes: 5 additions & 5 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,17 @@ including for developing the package.
- Uses [Quarto](https://quarto.org/) Markdown for the website content,
allowing for easy integration of code, text, and figures.
- Uses
[Commitizen](https://decisions.seedcase-project.org/why-changelog-with-commitizen)
[Commitizen](https://decisions.seedcase-project.org/why-changelog-with-commitizen/)
to
[check](https://decisions.seedcase-project.org/why-lint-with-commitizen/)
commit messages and automatically create the changelog.
- Automated Git tagging and GitHub releases with
[commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/)
that are based on messages following
[Conventional
Commits](https://decisions.seedcase-project.org/why-conventional-commits).
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/).
- Uses a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)
license for the website content.
- Uses an
[MIT](https://decisions.seedcase-project.org/why-mit-license/index.html)
- Uses an [MIT](https://decisions.seedcase-project.org/why-mit-license/)
license for the code.
- Optionally uses the
[`seedcase-theme`](https://github.com/seedcase-project/seedcase-theme)
Expand All @@ -68,6 +66,8 @@ including for developing the package.
- Uses [rumdl](https://rumdl.dev/) to format Markdown files so that they
are standardized and consistent across the project, as well as being
easier to read in raw form.
- Checks URLs with [Lychee](https://lychee.cli.rs) to ensure they aren't
broken or blocked.

## Want to contribute?

Expand Down
77 changes: 44 additions & 33 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,78 +1,89 @@
@_default:
just --list --unsorted

@_checks: check-spelling check-commits
@_checks: check-spelling check-urls check-commits

# Test Seedcase and non-Seedcase projects
@_tests: (test "true" "netlify") (test "false" "netlify") (test "true" "gh-pages") (test "false" "gh-pages")

@_builds: build-contributors build-website build-readme

# Run all build-related recipes in the justfile
run-all: update-quarto-theme update-template _checks format-md _tests _builds

# Install the pre-commit hooks
install-precommit:
# Install pre-commit hooks
uvx pre-commit install
# Run pre-commit hooks on all files
uvx pre-commit run --all-files
# Update versions of pre-commit hooks
uvx pre-commit autoupdate
# Install pre-commit hooks
uvx pre-commit install
# Run pre-commit hooks on all files
uvx pre-commit run --all-files
# Update versions of pre-commit hooks
uvx pre-commit autoupdate

# Update the Quarto seedcase-theme extension
update-quarto-theme:
# Add theme if it doesn't exist, update if it does
quarto update seedcase-project/seedcase-theme --no-prompt
# Add theme if it doesn't exist, update if it does
quarto update seedcase-project/seedcase-theme --no-prompt

# Update files in the template from the copier parent folder
update-template:
cp CODE_OF_CONDUCT.md .pre-commit-config.yaml .typos.toml .editorconfig .rumdl.toml template/
mkdir -p template/tools
cp tools/get-contributors.sh template/tools/
cp .github/pull_request_template.md template/.github/
cp .github/workflows/dependency-review.yml template/.github/workflows/
cp CODE_OF_CONDUCT.md .pre-commit-config.yaml .typos.toml .editorconfig .rumdl.toml template/
mkdir -p template/tools
cp tools/get-contributors.sh template/tools/
cp .github/pull_request_template.md template/.github/
cp .github/workflows/dependency-review.yml template/.github/workflows/

# Check the commit messages on the current branch that are not on the main branch
check-commits:
#!/usr/bin/env bash
branch_name=$(git rev-parse --abbrev-ref HEAD)
number_of_commits=$(git rev-list --count HEAD ^main)
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
then
# If issue happens, try `uv tool update-shell`
uvx --from commitizen cz check --rev-range main..HEAD
else
echo "On 'main' or current branch doesn't have any commits."
fi
#!/usr/bin/env bash
branch_name=$(git rev-parse --abbrev-ref HEAD)
number_of_commits=$(git rev-list --count HEAD ^main)
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
then
# If issue happens, try `uv tool update-shell`
uvx --from commitizen cz check --rev-range main..HEAD
else
echo "On 'main' or current branch doesn't have any commits."
fi

# Install lychee from https://lychee.cli.rs/guides/getting-started/

# Check that URLs work
check-urls:
lychee . \
--verbose \
--extensions md,qmd,jinja \
--exclude-path "_badges.qmd"

# Check for spelling errors in files
check-spelling:
uvx typos
uvx typos

# Format Markdown files
format-md:
uvx rumdl fmt --silent
uvx rumdl fmt --silent

# Test that a Python package can be created from the template, with parameters for: `is_seedcase_project` (true or false) and `hosting_provider` (either "gh-pages" or "netlify")
test is_seedcase_project="true" hosting_provider="netlify":
sh ./test-template.sh {{ is_seedcase_project }} {{ hosting_provider }}
sh ./test-template.sh {{ is_seedcase_project }} {{ hosting_provider }}

# Test template with the manual questionnaire answers
test-manual:
mkdir -p _temp/manual
uvx copier copy --trust -r HEAD . _temp/manual/test-template
mkdir -p _temp/manual
uvx copier copy --trust -r HEAD . _temp/manual/test-template

# Clean up any leftover and temporary build files
cleanup:
rm -rf _temp
rm -rf _temp

# Build the website using Quarto
build-website:
uvx --from quarto quarto render
uvx --from quarto quarto render

# Re-build the README file from the Quarto version
build-readme:
uvx --from quarto quarto render README.qmd --to gfm
uvx --from quarto quarto render README.qmd --to gfm

# Generate a Quarto include file with the contributors
build-contributors:
sh ./tools/get-contributors.sh seedcase-project/template-python-project > docs/includes/_contributors.qmd
sh ./tools/get-contributors.sh seedcase-project/template-python-project > docs/includes/_contributors.qmd
2 changes: 1 addition & 1 deletion template/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# EditorConfig settings. Some editors will read these automatically;
# for those that don't, see here: http://editorconfig.org/
# for those that don't, see here: https://editorconfig.org/

root = true

Expand Down
2 changes: 1 addition & 1 deletion template/404.qmd.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Let's get you back to greener grounds.

![](/_extensions/seedcase-project/seedcase-theme/images/404.svg){fig-alt="An illustration of the number 404 surrounded by trees and mountains"}

## Illustration by [Storyset](https://storyset.com/web) {.appendix}
## Illustration by [Storyset](https://storyset.com/online) {.appendix}
{%- else -%}
This page does not exist, go back to the [homepage](/index.qmd) or check the URL for typos.
{%- endif %}
4 changes: 2 additions & 2 deletions template/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

Since we follow
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits)
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
when writing commit messages, we're able to automatically create formal
releases of the Python package based on the commit messages. The
releases are also published to Zenodo for easier discovery, archival,
and citation purposes. We use
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen)
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/)
to be able to automatically create these releases, which uses
[SemVar](https://semverdoc.org) as the version numbering scheme.

Expand Down
4 changes: 2 additions & 2 deletions template/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ be reported by opening an issue or contacting one or more of the project
maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(<https://contributor-covenant.org>), version 1.0.0, available at
<https://contributor-covenant.org/version/1/0/0/>
(<https://www.contributor-covenant.org>), version 1.0.0, available at
<https://www.contributor-covenant.org/version/1/0/0/>
12 changes: 6 additions & 6 deletions template/CONTRIBUTING.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template. Both the uv and justfile websites have a more detailed guide
on using uv, but below are some simple instructions to get you started.

It's easiest to install uv and justfile using
[pipx](https://pypa.github.io/pipx/), so install that first. Then,
[pipx](https://pipx.pypa.io/stable/), so install that first. Then,
install uv and justfile by running:

``` bash
Expand All @@ -48,12 +48,12 @@ just run-all
```

When committing changes, please try to follow [Conventional
Commits](https://decisions.seedcase-project.org/why-conventional-commits)
Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
as Git messages. Using this convention allows us to be able to
automatically create a release based on the commit message by using
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen).
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/).
If you don't use Conventional Commits when making a commit, we will
revise the pull request title to follow that format, as we use [squash
merges](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/squashing-commits/about-squash-merges)
when merging pull requests, so all other commits in the pull request
will be squashed into one commit.
merges](https://git-scm.com/docs/git-merge) when merging pull requests,
so all other commits in the pull request will be squashed into one
commit.
2 changes: 1 addition & 1 deletion template/README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Seedcase template :tada:

- `.github/`: Contains GitHub-specific files, such as issue and pull
request templates, workflows,
[dependabot](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide)
[dependabot](https://docs.github.com/en/code-security/tutorials/secure-your-dependencies/dependabot-quickstart-guide)
configuration, pull request templates, and a
[CODEOWNERS](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)
file.
Expand Down
2 changes: 1 addition & 1 deletion template/_quarto.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ website:
pinned: true
title: false
{%- if is_seedcase_project %}
logo: "_extensions/seedcase-project/seedcase-theme/logos/navbar-logo-{{ github_repo }}.svg"
logo: "_extensions/seedcase-project/seedcase-theme/logos/{{ github_repo }}/navbar.svg"
logo-alt: "{{ github_repo }} logo: Main page"
{%- else %}
# TODO: add logo
Expand Down
Loading
Loading