Skip to content

Commit c9ccc23

Browse files
committed
audreyfeldroy/cookiecutter-pypackage https://github.com/audreyfeldroy/cookiecutter-pypackage
Initial project generated from Cookiecutter PyPackage template.
0 parents  commit c9ccc23

28 files changed

Lines changed: 1085 additions & 0 deletions

.editorconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.{html,css,js,json,sh,yml,yaml}]
13+
indent_size = 2
14+
15+
[*.bat]
16+
indent_style = tab
17+
end_of_line = crlf
18+
19+
[LICENSE]
20+
insert_final_newline = false
21+
22+
[justfile]
23+
indent_style = space
24+
indent_size = 4
25+
26+
# Ignore binary or generated files
27+
[*.{png,jpg,gif,ico,woff,woff2,ttf,eot,svg,pdf}]
28+
charset = unset
29+
end_of_line = unset
30+
indent_style = unset
31+
indent_size = unset
32+
trim_trailing_whitespace = unset
33+
insert_final_newline = unset
34+
max_line_length = unset
35+
36+
[*.{diff,patch}]
37+
trim_trailing_whitespace = false

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* Staticware version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
cooldown:
8+
default-days: 7
9+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
types:
10+
- opened
11+
- synchronize
12+
- reopened
13+
- ready_for_review
14+
15+
permissions: {}
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
lint:
23+
name: Lint
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
persist-credentials: false
29+
30+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
31+
32+
- name: Ruff format check
33+
run: uv run ruff format --check .
34+
35+
- name: Ruff lint
36+
run: uv run ruff check .
37+
38+
type-check:
39+
name: Type check
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
43+
with:
44+
persist-credentials: false
45+
46+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
47+
48+
- name: Type check with ty
49+
run: uv run ty check .
50+
51+
test:
52+
name: Test (Python ${{ matrix.python-version }})
53+
runs-on: ubuntu-latest
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
python-version: ["3.12", "3.13", "3.14"]
58+
steps:
59+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
60+
with:
61+
persist-credentials: false
62+
63+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
64+
65+
- name: Run tests with coverage
66+
run: uv run --python=${{ matrix.python-version }} coverage run -m pytest
67+
68+
- name: Upload coverage data
69+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
70+
with:
71+
name: coverage-${{ matrix.python-version }}
72+
path: .coverage.*
73+
include-hidden-files: true
74+
75+
coverage:
76+
name: Coverage
77+
needs: test
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
81+
with:
82+
persist-credentials: false
83+
84+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
85+
86+
- name: Download coverage data
87+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
88+
with:
89+
pattern: coverage-*
90+
merge-multiple: true
91+
92+
- name: Combine coverage
93+
run: uv run coverage combine
94+
95+
- name: Coverage report
96+
run: |
97+
echo '## Coverage Report' >> $GITHUB_STEP_SUMMARY
98+
echo '```' >> $GITHUB_STEP_SUMMARY
99+
uv run coverage report | tee -a $GITHUB_STEP_SUMMARY
100+
echo '```' >> $GITHUB_STEP_SUMMARY
101+
102+
all-checks-pass:
103+
name: All checks pass
104+
if: always()
105+
needs: [lint, type-check, test, coverage]
106+
runs-on: ubuntu-latest
107+
steps:
108+
- name: Check job results
109+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
110+
with:
111+
jobs: ${{ toJSON(needs) }}

.github/workflows/codeql.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 6 * * 1'
10+
11+
permissions: {}
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
permissions:
18+
security-events: write
19+
steps:
20+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
23+
24+
- name: Initialize CodeQL
25+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
26+
with:
27+
languages: python # Add c-cpp, go, java-kotlin, or swift if needed
28+
build-mode: none # Switch to autobuild for compiled languages
29+
queries: security-extended
30+
31+
- name: Perform CodeQL Analysis
32+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4

.github/workflows/docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions: {}
10+
11+
concurrency:
12+
group: docs-deploy
13+
# Let in-flight deployments finish to avoid a half-deployed site.
14+
cancel-in-progress: false
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
steps:
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
26+
27+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
28+
29+
- name: Build docs
30+
run: uv run --group docs zensical build --clean
31+
32+
- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
33+
34+
- uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
35+
with:
36+
path: site
37+
38+
deploy:
39+
name: Deploy
40+
needs: build
41+
runs-on: ubuntu-latest
42+
permissions:
43+
pages: write
44+
id-token: write
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
steps:
49+
- uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
50+
id: deployment

.github/workflows/publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions: {}
9+
10+
concurrency:
11+
group: publish
12+
13+
jobs:
14+
build:
15+
name: Build distribution
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
21+
22+
# Cache disabled to prevent cache-poisoning attacks on release artifacts.
23+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
24+
with:
25+
enable-cache: false
26+
27+
- name: Build
28+
run: uv build
29+
30+
- name: Upload distribution
31+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
32+
with:
33+
name: dist
34+
path: dist/
35+
36+
publish:
37+
name: Publish to PyPI
38+
needs: build
39+
runs-on: ubuntu-latest
40+
permissions:
41+
id-token: write
42+
attestations: write
43+
# Requires environment protection rules in GitHub Settings:
44+
# Settings > Environments > pypi > Add required reviewers
45+
# and restrict deployment to v* tags.
46+
environment:
47+
name: pypi
48+
url: https://pypi.org/p/staticware
49+
steps:
50+
- name: Download distribution
51+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
52+
with:
53+
name: dist
54+
path: dist/
55+
56+
- name: Attest build provenance
57+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
58+
with:
59+
subject-path: "dist/*"
60+
61+
- name: Publish to PyPI
62+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/zizmor.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Workflow security analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- ".github/workflows/**"
9+
pull_request:
10+
types:
11+
- opened
12+
- synchronize
13+
- reopened
14+
- ready_for_review
15+
paths:
16+
- ".github/workflows/**"
17+
18+
permissions: {}
19+
20+
jobs:
21+
zizmor:
22+
name: Run zizmor
23+
runs-on: ubuntu-latest
24+
permissions:
25+
security-events: write
26+
steps:
27+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
persist-credentials: false
30+
31+
- name: Run zizmor
32+
uses: zizmorcore/zizmor-action@0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d # v0.5.0
33+
with:
34+
inputs: ./.github/

0 commit comments

Comments
 (0)