Skip to content

Commit 7dcca82

Browse files
authored
Merge pull request #5 from HappyHackingSpace/project-refactor
Project refactor
2 parents 0777b2b + 6bb6d85 commit 7dcca82

33 files changed

+5378
-133
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Check http://editorconfig.org for more information
2+
# This is the main config file for this project:
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
end_of_line = lf
9+
indent_style = space
10+
insert_final_newline = true
11+
indent_size = 2
12+
13+
[*.{rs,py,pyi}]
14+
indent_size = 4
15+
16+
[*.snap]
17+
trim_trailing_whitespace = false
18+
19+
[*.md]
20+
max_line_length = 100
21+
22+
[*.toml]
23+
indent_size = 4

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Documentation
2+
*.html linguist-documentation
3+
docs/* linguist-documentation
4+
docs/examples/* linguist-documentation
5+
docs/md_v2/* linguist-documentation
6+
7+
# Explicitly mark Python as the main language
8+
*.py linguist-detectable=true
9+
*.py linguist-language=Python
10+
11+
# Exclude HTML from language statistics
12+
*.html linguist-detectable=false

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.13"]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v4
24+
with:
25+
version: "latest"
26+
27+
- name: Install dependencies
28+
run: |
29+
uv sync --dev
30+
31+
- name: Run linting
32+
run: |
33+
make lint

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0 # Needed for gh-deploy
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.13'
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v4
27+
with:
28+
version: "latest"
29+
30+
- name: Install dependencies
31+
run: |
32+
uv sync --dev
33+
34+
- name: Configure Git
35+
run: |
36+
git config --global user.name "github-actions[bot]"
37+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
38+
39+
- name: Deploy to GitHub Pages
40+
run: |
41+
uv run mkdocs gh-deploy --force

.github/workflows/release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
id-token: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.13'
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
version: "latest"
30+
31+
- name: Install dependencies
32+
run: |
33+
uv sync --dev
34+
35+
- name: Get package version
36+
id: get_version
37+
run: |
38+
VERSION=$(grep -m1 'version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
39+
echo "VERSION=$VERSION" >> $GITHUB_ENV
40+
echo "Package version: $VERSION"
41+
42+
- name: Build package
43+
run: uv build
44+
45+
- name: Run tests
46+
run: |
47+
uv run pytest
48+
49+
- name: Run linting
50+
run: |
51+
uv run ruff check
52+
uv run ruff format --check
53+
54+
- name: Create Release
55+
id: create_release
56+
uses: actions/create-release@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
tag_name: v${{ env.VERSION }}
61+
release_name: Release v${{ env.VERSION }}
62+
draft: false
63+
prerelease: false
64+
65+
- name: Upload Wheel
66+
uses: actions/upload-release-asset@v1
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
upload_url: ${{ steps.create_release.outputs.upload_url }}
71+
asset_path: ./dist/privacy_policy-${{ env.VERSION }}-py3-none-any.whl
72+
asset_name: privacy_policy-${{ env.VERSION }}-py3-none-any.whl
73+
asset_content_type: application/octet-stream
74+
75+
- name: Upload Source
76+
uses: actions/upload-release-asset@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
upload_url: ${{ steps.create_release.outputs.upload_url }}
81+
asset_path: ./dist/privacy-policy-${{ env.VERSION }}.tar.gz
82+
asset_name: privacy-policy-${{ env.VERSION }}.tar.gz
83+
asset_content_type: application/gzip

0 commit comments

Comments
 (0)