Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Commit bb87438

Browse files
committed
Add early boilerplate layout with base modules, config structure, logging setup,
linting/formatting config and minimal app entrypoint. This is an alpha-stage concept and not yet feature-complete.
0 parents  commit bb87438

19 files changed

Lines changed: 1072 additions & 0 deletions

.github/workflows/build.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
release:
7+
types: [published]
8+
9+
env:
10+
IMAGE_NAME: ghcr.io/${{ github.repository }}
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install Poetry
29+
uses: abatilo/actions-poetry@v3
30+
with:
31+
poetry-version: '1.8.4'
32+
33+
- name: Install dependencies
34+
run: poetry install
35+
36+
- name: Quick tests
37+
run: |
38+
poetry run pytest
39+
40+
- name: Log in to GHCR
41+
uses: docker/login-action@v3
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.actor }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Extract metadata
48+
id: meta
49+
uses: docker/metadata-action@v5
50+
with:
51+
images: ${{ env.IMAGE_NAME }}
52+
tags: |
53+
type=raw,value=latest
54+
type=sha
55+
type=ref,event=tag
56+
57+
- name: Set up buildx
58+
uses: docker/setup-buildx-action@v3
59+
60+
- name: Build and push
61+
uses: docker/build-push-action@v6
62+
with:
63+
context: .
64+
push: true
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
build-args: |
68+
APP_VERSION=${{ github.ref_name }}
69+
APP_COMMIT=${{ github.sha }}
70+
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
71+
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
72+
73+
- name: Smoke test container
74+
run: |
75+
docker run -d --name app-test -p 8080:8080 -p 8000:8000 ${{ env.IMAGE_NAME }}:latest
76+
sleep 5
77+
curl -f http://127.0.0.1:8080/healthz
78+
curl -f http://127.0.0.1:8080/readyz
79+
curl -f http://127.0.0.1:8000/metrics | head -n 20
80+
docker rm -f app-test

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
8+
jobs:
9+
lint-and-tests:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.11' # TODO: keep in sync with pyproject.toml
19+
20+
- name: Install Poetry
21+
uses: abatilo/actions-poetry@v3
22+
with:
23+
poetry-version: '1.8.4'
24+
25+
- name: Install dependencies
26+
run: poetry install
27+
28+
- name: Check pyproject
29+
run: poetry check
30+
31+
- name: Run pre-commit
32+
run: poetry run pre-commit run --all-files
33+
34+
- name: Run mypy
35+
run: poetry run mypy src
36+
37+
- name: Run tests
38+
run: poetry run pytest

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.pyo
5+
*.pyd
6+
*.so
7+
*.egg-info/
8+
dist/
9+
build/
10+
11+
# Virtual environments
12+
.venv/
13+
venv/
14+
env/
15+
16+
# Poetry
17+
poetry.lock
18+
19+
# PyCharm / VSCode / IDEs
20+
.idea/
21+
.vscode/
22+
23+
# Testing
24+
.pytest_cache/
25+
26+
# Environments
27+
.env
28+
.env.*
29+
30+
# Mypy
31+
.mypy_cache/
32+
33+
# Ruff
34+
.ruff_cache/
35+
36+
# Docker
37+
*.log

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
fail_fast: true
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.6.0
6+
hooks:
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
- id: check-yaml
10+
- id: check-toml
11+
- id: check-json
12+
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.7.1
15+
hooks:
16+
- id: ruff
17+
- id: ruff-format
18+
19+
- repo: local
20+
hooks:
21+
- id: mypy
22+
name: mypy
23+
entry: poetry run mypy src
24+
language: system
25+
pass_filenames: false

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# TODO: update maintainer and possibly python version
2+
FROM python:3.11-slim
3+
4+
ENV PYTHONUNBUFFERED=1
5+
WORKDIR /app
6+
7+
RUN apt-get update && \
8+
apt-get install -y --no-install-recommends build-essential && \
9+
rm -rf /var/lib/apt/lists/*
10+
11+
COPY pyproject.toml poetry.lock* /app/
12+
13+
RUN pip install --no-cache-dir poetry && \
14+
poetry install --no-root
15+
16+
COPY src /app/src
17+
ENV PYTHONPATH=/app/src
18+
19+
EXPOSE 8000
20+
21+
# TODO: rename when changing entrypoint
22+
CMD ["poetry", "run", "app"]

0 commit comments

Comments
 (0)