Skip to content

Commit c59ab49

Browse files
committed
feat: ✨ copy over static files to template folder
1 parent f5ef33f commit c59ab49

34 files changed

+1208
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
_ignore
33
bin/
44
dev/
5+
_temp/
56

67
# Temporary files
78
*.tmp

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Template for Seedcase Python packages
22

3-
This repository contains a template for setting up new Python package projects in Seedcase. The first step is to create a new repository using this template. This can easily be done by clicking the "Use this template" button on the repository page or by using the GitHub CLI:
3+
This repository contains a template for setting up new Python package
4+
projects in Seedcase. The first step is to create a new repository using
5+
this template. This can easily be done by clicking the "Use this
6+
template" button on the repository page or by using the GitHub CLI:
47

58
``` bash
69
# NAME is the name to give the new repository
@@ -9,15 +12,18 @@ gh repo create NAME --template seedcase-project/template-python-project
912

1013
## Setting things up after cloning
1114

12-
Search for `NAME` and `REPO` and replace them with the name of your project and the repository name. Then look for any `TODO` items.
15+
Search for `NAME` and `REPO` and replace them with the name of your
16+
project and the repository name. Then look for any `TODO` items.
1317

1418
## Setting things up
1519

16-
Use the commands found in [`spaid`](https://github.com/seedcase-project/spaid) repo to run the next setup steps.
20+
Use the commands found in
21+
[`spaid`](https://github.com/seedcase-project/spaid) repo to run the
22+
next setup steps.
1723

1824
Need to install these packages after:
1925

2026
``` bash
2127
uv add --dev pre-commit ruff typos pytest bandit commitizen \
22-
genbadge jupyter pytest-cov quartodoc
28+
genbadge jupyter pytest-cov quartodoc types-tabulate mypy vulture
2329
```

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

0 commit comments

Comments
 (0)