Skip to content

Commit bc6bf79

Browse files
feat: ✨ copy over static files to template folder (#117)
# Description This PR creates the `template` folder and copies over files that don't have copier variables. Files copied from `template-data-package` and Sprout. This PR needs an in-depth review. ## Checklist - [x] Added or updated tests - [x] Updated documentation - [x] Ran `just run-all` -- will fail --------- Co-authored-by: Luke W. Johnston <[email protected]>
1 parent fc90ddc commit bc6bf79

29 files changed

+1121
-0
lines changed

template/.cz.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tool.commitizen]
2+
bump_message = "build(version): :bookmark: update version from $current_version to $new_version"
3+
update_changelog_on_bump = true
4+
version_provider = "uv"
5+
# Don't regenerate the changelog on every update
6+
changelog_incremental = true

template/.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# EditorConfig settings. Some editors will read these automatically;
2+
# for those that don't, see here: http://editorconfig.org/
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_style = space
9+
indent_size = 2
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
max_line_length = 88
14+
15+
# Have a bit shorter line length for text docs
16+
[*.{txt,md,qmd}]
17+
max_line_length = 72
18+
indent_size = 4
19+
20+
# Python always uses 4 spaces for tabs
21+
[*.py]
22+
indent_style = space
23+
indent_size = 4
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Description
2+
3+
This PR DESCRIBE CHANGES.
4+
5+
Closes #
6+
7+
This PR needs a quick/an in-depth review.
8+
9+
## Checklist
10+
11+
- [ ] Added or updated tests
12+
- [ ] Updated documentation
13+
- [ ] Ran `just run-all`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build package
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
# Limit token permissions for security
12+
permissions: read-all
13+
14+
jobs:
15+
build:
16+
uses: seedcase-project/.github/.github/workflows/reusable-build-python.yml@main
17+
# Permissions needed for pushing to the coverage branch.
18+
permissions:
19+
contents: write
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Limit token permissions for security
9+
permissions: read-all
10+
11+
jobs:
12+
build-website:
13+
uses: seedcase-project/.github/.github/workflows/reusable-build-docs-with-python.yml@main
14+
secrets:
15+
netlify-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
16+
# This is to allow using `gh` CLI
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: "Security: Dependency Review"
10+
on: pull_request
11+
12+
# Limit token permissions for security
13+
permissions: read-all
14+
15+
jobs:
16+
dependency-review:
17+
uses: seedcase-project/.github/.github/workflows/reusable-dependency-review.yml@main
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Limit token permissions for security
9+
permissions: read-all
10+
11+
jobs:
12+
release:
13+
# This job outputs env variables `previous_version` and `current_version`.
14+
# Only give permissions for this job.
15+
permissions:
16+
contents: write
17+
uses: seedcase-project/.github/.github/workflows/reusable-release-project.yml@main
18+
with:
19+
app-id: ${{ vars.UPDATE_VERSION_APP_ID }}
20+
secrets:
21+
update-version-gh-token: ${{ secrets.UPDATE_VERSION_TOKEN }}
22+
23+
pypi-publish:
24+
name: Publish to PyPI
25+
runs-on: ubuntu-latest
26+
# Only give permissions for this job.
27+
permissions:
28+
# IMPORTANT: mandatory for trusted publishing.
29+
id-token: write
30+
environment:
31+
name: pypi
32+
needs:
33+
- release
34+
if: ${{ needs.release.outputs.previous_version != needs.release.outputs.current_version }}
35+
steps:
36+
- name: Harden the runner (Audit all outbound calls)
37+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
38+
with:
39+
egress-policy: audit
40+
41+
- name: Checkout
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
with:
44+
# Need to explicitly get the current version, otherwise it defaults to current commit
45+
# (which is not the same as the release/version commit).
46+
ref: ${{ needs.release.outputs.current_version }}
47+
48+
# This workflow and the publish workflows are based on:
49+
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
50+
# - https://www.andrlik.org/dispatches/til-use-uv-for-build-and-publish-github-actions/
51+
# - https://github.com/astral-sh/trusted-publishing-examples
52+
- name: Set up uv
53+
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
54+
55+
- name: Build distributions
56+
# Builds dists from source and stores them in the dist/ directory.
57+
run: uv build
58+
59+
- name: Publish 📦 to PyPI
60+
# Only publish if the option is explicitly set in the calling workflow.
61+
run: uv publish --trusted-publishing always
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
name: "Security: Scorecard"
5+
on:
6+
# For Branch-Protection check. Only the default branch is supported. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
8+
branch_protection_rule:
9+
# To guarantee Maintained check is occasionally updated. See
10+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
11+
schedule:
12+
- cron: '20 7 * * 2'
13+
push:
14+
branches:
15+
- main
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Analysis
23+
uses: seedcase-project/.github/.github/workflows/reusable-scorecards.yml@main
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write

template/.gitignore

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Development files and folders
2+
_ignore
3+
bin/
4+
dev/
5+
6+
# Temporary files
7+
*.tmp
8+
9+
# Any IDE specific folders
10+
.idea
11+
12+
# Any .env files
13+
.env
14+
.env.*
15+
**/.env.*
16+
.env
17+
.venv
18+
env/
19+
venv/
20+
ENV/
21+
env.bak/
22+
venv.bak/
23+
24+
# Python specific content
25+
venv
26+
__pycache__/
27+
*.py[cod]
28+
29+
# Python packaging and distribution
30+
.Python
31+
build/
32+
develop-eggs/
33+
dist/
34+
downloads/
35+
eggs/
36+
.eggs/
37+
lib/
38+
lib64/
39+
parts/
40+
sdist/
41+
var/
42+
wheels/
43+
share/python-wheels/
44+
*.egg-info/
45+
.installed.cfg
46+
*.egg
47+
MANIFEST
48+
49+
# Python testing and code coverage
50+
htmlcov/
51+
.tox/
52+
.nox/
53+
.coverage
54+
.coverage.*
55+
coverage.*
56+
.cache
57+
nosetests.xml
58+
*.cover
59+
*.py,cover
60+
.hypothesis/
61+
.pytest_cache/
62+
cover/
63+
64+
# MacOS
65+
.DS_Store
66+
67+
# Quarto
68+
/.quarto/
69+
docs/.quarto/
70+
*.ipynb
71+
*.quarto_ipynb
72+
*.storage
73+
74+
# Quartodoc
75+
/docs/reference/
76+
objects.json
77+
78+
# Website generation
79+
_site
80+
_book
81+
public
82+
site
83+
84+
85+
# Misc files
86+
*.log

template/.pre-commit-config.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
ci:
4+
autofix_commit_msg: "chore(pre-commit): :pencil2: automatic fixes"
5+
autoupdate_commit_msg: "ci(pre-commit): :construction_worker: update pre-commit CI version"
6+
7+
repos:
8+
- repo: https://github.com/gitleaks/gitleaks
9+
rev: v8.28.0
10+
hooks:
11+
- id: gitleaks
12+
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v5.0.0
15+
hooks:
16+
- id: trailing-whitespace
17+
- id: end-of-file-fixer
18+
19+
- repo: https://github.com/commitizen-tools/commitizen
20+
rev: v4.8.3
21+
hooks:
22+
- id: commitizen
23+
24+
# Use the mirror since the main `typos` repo has tags for different
25+
# sub-packages, which confuses pre-commit when it tries to find the latest
26+
# version
27+
- repo: https://github.com/adhtruong/mirrors-typos
28+
rev: v1.34.0
29+
hooks:
30+
- id: typos

0 commit comments

Comments
 (0)