diff --git a/.editorconfig b/.editorconfig index 6fd615b..9cecc03 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/404.qmd b/404.qmd index 817c6db..87ccc8c 100644 --- a/404.qmd +++ b/404.qmd @@ -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} diff --git a/CHANGELOG.md b/CHANGELOG.md index 220debb..50625ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index e6f3284..6f8f13c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -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 -(), version 1.0.0, available at - +(), version 1.0.0, available at + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 724a681..2bc9016 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 @@ -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. diff --git a/README.md b/README.md index 965e27d..ff8fa0f 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 diff --git a/README.qmd b/README.qmd index ebf8dfa..591532d 100644 --- a/README.qmd +++ b/README.qmd @@ -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. diff --git a/docs/includes/_contributors.qmd b/docs/includes/_contributors.qmd index f7987aa..a0a0259 100644 --- a/docs/includes/_contributors.qmd +++ b/docs/includes/_contributors.qmd @@ -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) diff --git a/index.qmd b/index.qmd index 79754d2..0139e2a 100644 --- a/index.qmd +++ b/index.qmd @@ -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) @@ -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? diff --git a/justfile b/justfile index ae250a7..69c8c63 100644 --- a/justfile +++ b/justfile @@ -1,9 +1,11 @@ @_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 @@ -11,68 +13,77 @@ 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 diff --git a/template/.editorconfig b/template/.editorconfig index 6fd615b..9cecc03 100644 --- a/template/.editorconfig +++ b/template/.editorconfig @@ -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 diff --git a/template/404.qmd.jinja b/template/404.qmd.jinja index 8c41ab0..fd84eef 100644 --- a/template/404.qmd.jinja +++ b/template/404.qmd.jinja @@ -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 %} diff --git a/template/CHANGELOG.md b/template/CHANGELOG.md index dbea7ff..ea23039 100644 --- a/template/CHANGELOG.md +++ b/template/CHANGELOG.md @@ -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. diff --git a/template/CODE_OF_CONDUCT.md b/template/CODE_OF_CONDUCT.md index e6f3284..6f8f13c 100644 --- a/template/CODE_OF_CONDUCT.md +++ b/template/CODE_OF_CONDUCT.md @@ -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 -(), version 1.0.0, available at - +(), version 1.0.0, available at + diff --git a/template/CONTRIBUTING.md.jinja b/template/CONTRIBUTING.md.jinja index 78572ad..de13063 100644 --- a/template/CONTRIBUTING.md.jinja +++ b/template/CONTRIBUTING.md.jinja @@ -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 @@ -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. diff --git a/template/README.qmd b/template/README.qmd index fce0f0f..ee40fe8 100644 --- a/template/README.qmd +++ b/template/README.qmd @@ -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. diff --git a/template/_quarto.yml.jinja b/template/_quarto.yml.jinja index 0569b5a..d7ea44a 100644 --- a/template/_quarto.yml.jinja +++ b/template/_quarto.yml.jinja @@ -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 diff --git a/template/docs/LICENSE.md b/template/docs/LICENSE.md index 8fc427d..8577d9d 100644 --- a/template/docs/LICENSE.md +++ b/template/docs/LICENSE.md @@ -30,7 +30,7 @@ exhaustive, and do not form part of our licenses. not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for - licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). + licensors](https://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). - **Considerations for the public:** By using one of our public licenses, a licensor grants the public permission to use the @@ -46,7 +46,7 @@ exhaustive, and do not form part of our licenses. described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the - public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). + public](https://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). ## Creative Commons Attribution 4.0 International Public License @@ -357,7 +357,7 @@ d. Nothing in this Public License constitutes or may be interpreted as > indicating that material is shared under a Creative Commons public > license or as otherwise permitted by the Creative Commons policies > published at -> [creativecommons.org/policies](http://creativecommons.org/policies), +> [creativecommons.org/policies/](https://creativecommons.org/policies/), > Creative Commons does not authorize the use of the trademark “Creative > Commons” or any other trademark or logo of Creative Commons without > its prior written consent including, without limitation, in connection diff --git a/template/justfile.jinja b/template/justfile.jinja index 242c34f..44c1081 100644 --- a/template/justfile.jinja +++ b/template/justfile.jinja @@ -1,8 +1,10 @@ @_default: just --list --unsorted -@_checks: check-python check-unused check-security check-spelling check-commits +@_checks: check-python check-unused check-security check-spelling check-urls check-commits + @_tests: test-python + @_builds: build-contributors build-website build-readme # Run all build-related recipes in the justfile @@ -96,6 +98,14 @@ check-security: check-spelling: uv run typos +# Install lychee from https://lychee.cli.rs/guides/getting-started/ +# Check that URLs work +check-urls: + lychee . \ + --verbose \ + --extensions md,qmd,py \ + --exclude-path "_badges.qmd" + # Build the documentation as PDF using Quarto build-pdf: # To let Quarto know where python is.