skaal 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- skaal-0.1.0/.github/workflows/ci.yml +51 -0
- skaal-0.1.0/.github/workflows/release.yml +107 -0
- skaal-0.1.0/.gitignore +45 -0
- skaal-0.1.0/.pre-commit-config.yaml +70 -0
- skaal-0.1.0/.yamllint +13 -0
- skaal-0.1.0/CONTRIBUTING.md +158 -0
- skaal-0.1.0/Cargo.toml +8 -0
- skaal-0.1.0/LICENSE +674 -0
- skaal-0.1.0/Makefile +57 -0
- skaal-0.1.0/PKG-INFO +784 -0
- skaal-0.1.0/README.md +64 -0
- skaal-0.1.0/catalogs/aws.toml +164 -0
- skaal-0.1.0/catalogs/gcp.toml +149 -0
- skaal-0.1.0/catalogs/local.toml +43 -0
- skaal-0.1.0/docs/design/001-infrastructure-as-constraints.md +38 -0
- skaal-0.1.0/docs/design/002-z3-backend-selection.md +33 -0
- skaal-0.1.0/docs/design/003-catalog-toml-format.md +40 -0
- skaal-0.1.0/docs/design/004-six-stage-migration.md +38 -0
- skaal-0.1.0/docs/design/005-local-runtime-design.md +36 -0
- skaal-0.1.0/docs/design/006-rust-mesh-architecture.md +37 -0
- skaal-0.1.0/docs/design/007-schema-versioning.md +45 -0
- skaal-0.1.0/examples/01_hello_world/__init__.py +0 -0
- skaal-0.1.0/examples/01_hello_world/app.py +55 -0
- skaal-0.1.0/examples/02_todo_api/__init__.py +0 -0
- skaal-0.1.0/examples/02_todo_api/app.py +145 -0
- skaal-0.1.0/examples/03_dash_app/__init__.py +0 -0
- skaal-0.1.0/examples/03_dash_app/app.py +148 -0
- skaal-0.1.0/examples/counter.py +55 -0
- skaal-0.1.0/examples/todo_api.py +145 -0
- skaal-0.1.0/mesh/Cargo.toml +20 -0
- skaal-0.1.0/mesh/src/lib.rs +65 -0
- skaal-0.1.0/pyproject.toml +114 -0
- skaal-0.1.0/skaal/__init__.py +76 -0
- skaal-0.1.0/skaal/agent.py +69 -0
- skaal-0.1.0/skaal/app.py +123 -0
- skaal-0.1.0/skaal/backends/__init__.py +42 -0
- skaal-0.1.0/skaal/backends/base.py +41 -0
- skaal-0.1.0/skaal/backends/dynamodb_backend.py +127 -0
- skaal-0.1.0/skaal/backends/firestore_backend.py +115 -0
- skaal-0.1.0/skaal/backends/local_backend.py +276 -0
- skaal-0.1.0/skaal/backends/postgres_backend.py +141 -0
- skaal-0.1.0/skaal/backends/redis_backend.py +93 -0
- skaal-0.1.0/skaal/backends/sqlite_backend.py +117 -0
- skaal-0.1.0/skaal/catalog/__init__.py +15 -0
- skaal-0.1.0/skaal/catalog/loader.py +76 -0
- skaal-0.1.0/skaal/catalog/models.py +104 -0
- skaal-0.1.0/skaal/catalog/registry.py +133 -0
- skaal-0.1.0/skaal/channel.py +44 -0
- skaal-0.1.0/skaal/cli/__init__.py +1 -0
- skaal-0.1.0/skaal/cli/_utils.py +57 -0
- skaal-0.1.0/skaal/cli/build_cmd.py +204 -0
- skaal-0.1.0/skaal/cli/catalog_cmd.py +65 -0
- skaal-0.1.0/skaal/cli/config.py +146 -0
- skaal-0.1.0/skaal/cli/deploy_cmd.py +116 -0
- skaal-0.1.0/skaal/cli/diff_cmd.py +163 -0
- skaal-0.1.0/skaal/cli/infra_cmd.py +129 -0
- skaal-0.1.0/skaal/cli/main.py +31 -0
- skaal-0.1.0/skaal/cli/migrate_cmd.py +166 -0
- skaal-0.1.0/skaal/cli/plan_cmd.py +113 -0
- skaal-0.1.0/skaal/cli/run_cmd.py +74 -0
- skaal-0.1.0/skaal/components.py +365 -0
- skaal-0.1.0/skaal/decorators.py +149 -0
- skaal-0.1.0/skaal/deploy/__init__.py +5 -0
- skaal-0.1.0/skaal/deploy/_deps.py +98 -0
- skaal-0.1.0/skaal/deploy/_render.py +167 -0
- skaal-0.1.0/skaal/deploy/aws_lambda.py +330 -0
- skaal-0.1.0/skaal/deploy/config.py +304 -0
- skaal-0.1.0/skaal/deploy/docker_compose.py +330 -0
- skaal-0.1.0/skaal/deploy/gcp_cloudrun.py +391 -0
- skaal-0.1.0/skaal/deploy/pulumi_backend.py +32 -0
- skaal-0.1.0/skaal/deploy/push.py +266 -0
- skaal-0.1.0/skaal/deploy/templates/aws/handler.py +39 -0
- skaal-0.1.0/skaal/deploy/templates/aws/handler_wsgi.py +25 -0
- skaal-0.1.0/skaal/deploy/templates/gcp/Dockerfile +16 -0
- skaal-0.1.0/skaal/deploy/templates/gcp/Dockerfile_wsgi +17 -0
- skaal-0.1.0/skaal/deploy/templates/gcp/main.py +26 -0
- skaal-0.1.0/skaal/deploy/templates/gcp/main_wsgi.py +23 -0
- skaal-0.1.0/skaal/deploy/templates/local/Dockerfile +16 -0
- skaal-0.1.0/skaal/deploy/templates/local/docker-compose.yml +18 -0
- skaal-0.1.0/skaal/deploy/templates/local/main.py +21 -0
- skaal-0.1.0/skaal/deploy/templates/local/main_wsgi.py +23 -0
- skaal-0.1.0/skaal/migrate/__init__.py +14 -0
- skaal-0.1.0/skaal/migrate/engine.py +136 -0
- skaal-0.1.0/skaal/migrate/shadow.py +138 -0
- skaal-0.1.0/skaal/module.py +408 -0
- skaal-0.1.0/skaal/patterns.py +313 -0
- skaal-0.1.0/skaal/plan.py +123 -0
- skaal-0.1.0/skaal/runtime/__init__.py +19 -0
- skaal-0.1.0/skaal/runtime/agent_registry.py +87 -0
- skaal-0.1.0/skaal/runtime/channels.py +53 -0
- skaal-0.1.0/skaal/runtime/distributed.py +74 -0
- skaal-0.1.0/skaal/runtime/local.py +386 -0
- skaal-0.1.0/skaal/runtime/state.py +62 -0
- skaal-0.1.0/skaal/solver/__init__.py +19 -0
- skaal-0.1.0/skaal/solver/components.py +123 -0
- skaal-0.1.0/skaal/solver/compute.py +160 -0
- skaal-0.1.0/skaal/solver/explain.py +80 -0
- skaal-0.1.0/skaal/solver/graph.py +112 -0
- skaal-0.1.0/skaal/solver/plan.py +96 -0
- skaal-0.1.0/skaal/solver/solver.py +138 -0
- skaal-0.1.0/skaal/solver/stability.py +153 -0
- skaal-0.1.0/skaal/solver/storage.py +176 -0
- skaal-0.1.0/skaal/storage.py +185 -0
- skaal-0.1.0/skaal/types/__init__.py +47 -0
- skaal-0.1.0/skaal/types/compute.py +101 -0
- skaal-0.1.0/skaal/types/constraints.py +89 -0
- skaal-0.1.0/skaal/types/schema.py +86 -0
- skaal-0.1.0/tests/__init__.py +0 -0
- skaal-0.1.0/tests/conftest.py +14 -0
- skaal-0.1.0/tests/runtime/__init__.py +0 -0
- skaal-0.1.0/tests/runtime/conftest.py +1 -0
- skaal-0.1.0/tests/runtime/test_local.py +235 -0
- skaal-0.1.0/tests/runtime/test_local_runtime_extras.py +120 -0
- skaal-0.1.0/tests/runtime/test_runtime_modules.py +197 -0
- skaal-0.1.0/tests/schema/__init__.py +0 -0
- skaal-0.1.0/tests/schema/conftest.py +1 -0
- skaal-0.1.0/tests/schema/test_migration.py +360 -0
- skaal-0.1.0/tests/solver/__init__.py +0 -0
- skaal-0.1.0/tests/solver/conftest.py +64 -0
- skaal-0.1.0/tests/solver/test_compute_solver.py +185 -0
- skaal-0.1.0/tests/solver/test_solver.py +224 -0
- skaal-0.1.0/tests/solver/test_solver_extras.py +218 -0
- skaal-0.1.0/tests/storage/__init__.py +0 -0
- skaal-0.1.0/tests/storage/conftest.py +1 -0
- skaal-0.1.0/tests/storage/test_catalog.py +217 -0
- skaal-0.1.0/tests/storage/test_event_log.py +192 -0
- skaal-0.1.0/tests/storage/test_schema_storage.py +422 -0
- skaal-0.1.0/tests/storage/test_sqlite_backend.py +156 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, ci]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
pre-commit:
|
|
11
|
+
name: Pre-commit
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Install uv
|
|
17
|
+
uses: astral-sh/setup-uv@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.11"
|
|
23
|
+
|
|
24
|
+
- name: Install dev dependencies
|
|
25
|
+
run: uv sync --group dev
|
|
26
|
+
|
|
27
|
+
- uses: pre-commit/action@v3.0.1
|
|
28
|
+
|
|
29
|
+
test:
|
|
30
|
+
name: Test (Python ${{ matrix.python-version }})
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v4
|
|
38
|
+
|
|
39
|
+
- name: Install uv
|
|
40
|
+
uses: astral-sh/setup-uv@v4
|
|
41
|
+
|
|
42
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
43
|
+
uses: actions/setup-python@v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: ${{ matrix.python-version }}
|
|
46
|
+
|
|
47
|
+
- name: Install dev dependencies
|
|
48
|
+
run: uv sync --group dev
|
|
49
|
+
|
|
50
|
+
- name: Run tests
|
|
51
|
+
run: uv run pytest --tb=short -q
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Build distribution
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.11"
|
|
25
|
+
|
|
26
|
+
- name: Install build dependencies
|
|
27
|
+
run: uv sync --group dev
|
|
28
|
+
|
|
29
|
+
- name: Build sdist and wheel
|
|
30
|
+
run: uv build
|
|
31
|
+
|
|
32
|
+
- name: Verify distributions
|
|
33
|
+
run: |
|
|
34
|
+
ls -lh dist/
|
|
35
|
+
uv pip install twine
|
|
36
|
+
uv run twine check dist/*
|
|
37
|
+
|
|
38
|
+
- name: Upload distributions
|
|
39
|
+
uses: actions/upload-artifact@v4
|
|
40
|
+
with:
|
|
41
|
+
name: dist
|
|
42
|
+
path: dist/
|
|
43
|
+
if-no-files-found: error
|
|
44
|
+
|
|
45
|
+
publish-pypi:
|
|
46
|
+
name: Publish to PyPI
|
|
47
|
+
needs: build
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
environment:
|
|
50
|
+
name: pypi
|
|
51
|
+
url: https://pypi.org/p/skaal
|
|
52
|
+
permissions:
|
|
53
|
+
id-token: write # Required for OIDC trusted publishing
|
|
54
|
+
steps:
|
|
55
|
+
- name: Download distributions
|
|
56
|
+
uses: actions/download-artifact@v4
|
|
57
|
+
with:
|
|
58
|
+
name: dist
|
|
59
|
+
path: dist/
|
|
60
|
+
|
|
61
|
+
- name: Publish to PyPI
|
|
62
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
63
|
+
|
|
64
|
+
publish-testpypi:
|
|
65
|
+
name: Publish to TestPyPI
|
|
66
|
+
needs: build
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
environment:
|
|
69
|
+
name: testpypi
|
|
70
|
+
url: https://test.pypi.org/p/skaal
|
|
71
|
+
permissions:
|
|
72
|
+
id-token: write
|
|
73
|
+
steps:
|
|
74
|
+
- name: Download distributions
|
|
75
|
+
uses: actions/download-artifact@v4
|
|
76
|
+
with:
|
|
77
|
+
name: dist
|
|
78
|
+
path: dist/
|
|
79
|
+
|
|
80
|
+
- name: Publish to TestPyPI
|
|
81
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
82
|
+
with:
|
|
83
|
+
repository-url: https://test.pypi.org/legacy/
|
|
84
|
+
skip-existing: true
|
|
85
|
+
|
|
86
|
+
create-github-release:
|
|
87
|
+
name: Create GitHub Release
|
|
88
|
+
needs: publish-pypi
|
|
89
|
+
runs-on: ubuntu-latest
|
|
90
|
+
permissions:
|
|
91
|
+
contents: write
|
|
92
|
+
steps:
|
|
93
|
+
- uses: actions/checkout@v4
|
|
94
|
+
with:
|
|
95
|
+
fetch-depth: 0
|
|
96
|
+
|
|
97
|
+
- name: Download distributions
|
|
98
|
+
uses: actions/download-artifact@v4
|
|
99
|
+
with:
|
|
100
|
+
name: dist
|
|
101
|
+
path: dist/
|
|
102
|
+
|
|
103
|
+
- name: Create GitHub Release
|
|
104
|
+
uses: softprops/action-gh-release@v2
|
|
105
|
+
with:
|
|
106
|
+
files: dist/*
|
|
107
|
+
generate_release_notes: true
|
skaal-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
.Python
|
|
7
|
+
*.egg
|
|
8
|
+
*.egg-info/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
.eggs/
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
.env
|
|
16
|
+
*.so
|
|
17
|
+
|
|
18
|
+
# Rust
|
|
19
|
+
target/
|
|
20
|
+
Cargo.lock
|
|
21
|
+
|
|
22
|
+
# Skaal
|
|
23
|
+
plan.skaal.lock
|
|
24
|
+
*.plan.lock
|
|
25
|
+
artifacts/
|
|
26
|
+
|
|
27
|
+
# Tools
|
|
28
|
+
.ruff_cache/
|
|
29
|
+
.pytest_cache/
|
|
30
|
+
.mypy_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
|
|
34
|
+
# IDEs
|
|
35
|
+
.vscode/
|
|
36
|
+
.idea/
|
|
37
|
+
*.swp
|
|
38
|
+
*.swo
|
|
39
|
+
|
|
40
|
+
# OS
|
|
41
|
+
.DS_Store
|
|
42
|
+
Thumbs.db
|
|
43
|
+
|
|
44
|
+
# uv
|
|
45
|
+
uv.lock
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
# General file checks
|
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
|
+
rev: v6.0.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: trailing-whitespace
|
|
7
|
+
exclude: '^(skaal/deploy/templates/|\.git)'
|
|
8
|
+
- id: end-of-file-fixer
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
args: ['--unsafe']
|
|
11
|
+
exclude: '^skaal/deploy/templates/'
|
|
12
|
+
- id: check-json
|
|
13
|
+
- id: check-toml
|
|
14
|
+
- id: check-merge-conflict
|
|
15
|
+
- id: debug-statements
|
|
16
|
+
exclude: '^skaal/deploy/templates/'
|
|
17
|
+
- id: mixed-line-ending
|
|
18
|
+
args: ['--fix=lf']
|
|
19
|
+
|
|
20
|
+
# Python formatting (Ruff)
|
|
21
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
22
|
+
rev: v0.3.5
|
|
23
|
+
hooks:
|
|
24
|
+
- id: ruff
|
|
25
|
+
args: [--fix]
|
|
26
|
+
exclude: '^skaal/deploy/templates/'
|
|
27
|
+
- id: ruff-format
|
|
28
|
+
stages: [pre-commit]
|
|
29
|
+
exclude: '^skaal/deploy/templates/'
|
|
30
|
+
|
|
31
|
+
# Type checking (MyPy)
|
|
32
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
33
|
+
rev: v1.8.0
|
|
34
|
+
hooks:
|
|
35
|
+
- id: mypy
|
|
36
|
+
additional_dependencies:
|
|
37
|
+
- pydantic>=2.0
|
|
38
|
+
- pydantic-settings>=2.0
|
|
39
|
+
- z3-solver>=4.12
|
|
40
|
+
args: [--ignore-missing-imports]
|
|
41
|
+
exclude: ^(tests/|examples/|skaal/deploy/templates/)
|
|
42
|
+
|
|
43
|
+
# YAML linting
|
|
44
|
+
- repo: https://github.com/adrienverge/yamllint
|
|
45
|
+
rev: v1.35.1
|
|
46
|
+
hooks:
|
|
47
|
+
- id: yamllint
|
|
48
|
+
args: [-c, .yamllint]
|
|
49
|
+
exclude: '^skaal/deploy/templates/|^artifacts/'
|
|
50
|
+
|
|
51
|
+
# Security checks
|
|
52
|
+
- repo: https://github.com/PyCQA/bandit
|
|
53
|
+
rev: 1.7.5
|
|
54
|
+
hooks:
|
|
55
|
+
- id: bandit
|
|
56
|
+
additional_dependencies: [pbr]
|
|
57
|
+
args: [--severity-level=medium]
|
|
58
|
+
exclude: ^(tests/|skaal/deploy/templates/)
|
|
59
|
+
|
|
60
|
+
ci:
|
|
61
|
+
autofix_commit_msg: |
|
|
62
|
+
[pre-commit.ci] auto fixes for pre-commit hooks
|
|
63
|
+
|
|
64
|
+
for more information, see https://pre-commit.ci
|
|
65
|
+
autofix_prs: true
|
|
66
|
+
autoupdate_branch: ''
|
|
67
|
+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
|
|
68
|
+
autoupdate_schedule: weekly
|
|
69
|
+
skip: [mypy] # MyPy can be slow, skip in CI if desired
|
|
70
|
+
submodules: false
|
skaal-0.1.0/.yamllint
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Contributing to Skaal
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to Skaal! This document provides guidelines for contributing to the project.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
### 1. Clone and Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/Elouen-ginat/Skaal.git
|
|
11
|
+
cd Skaal
|
|
12
|
+
|
|
13
|
+
# Install with dev dependencies
|
|
14
|
+
pip install -e ".[dev]"
|
|
15
|
+
# or with uv:
|
|
16
|
+
uv sync --group dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Set Up Pre-commit Hooks
|
|
20
|
+
|
|
21
|
+
Pre-commit hooks ensure code quality before each commit:
|
|
22
|
+
|
|
23
|
+
**macOS/Linux:**
|
|
24
|
+
```bash
|
|
25
|
+
bash scripts/setup-pre-commit.sh
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Windows:**
|
|
29
|
+
```bash
|
|
30
|
+
scripts\setup-pre-commit.bat
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Manual:**
|
|
34
|
+
```bash
|
|
35
|
+
pre-commit install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
See [PRE_COMMIT_SETUP.md](PRE_COMMIT_SETUP.md) for detailed information.
|
|
39
|
+
|
|
40
|
+
### 3. Verify Setup
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Run all hooks on your changes
|
|
44
|
+
pre-commit run --all-files
|
|
45
|
+
|
|
46
|
+
# Run tests
|
|
47
|
+
pytest
|
|
48
|
+
|
|
49
|
+
# Type checking
|
|
50
|
+
mypy skaal tests
|
|
51
|
+
|
|
52
|
+
# Linting
|
|
53
|
+
ruff check skaal tests
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Workflow
|
|
57
|
+
|
|
58
|
+
1. Create a feature branch: `git checkout -b feature/my-feature`
|
|
59
|
+
2. Make changes (pre-commit hooks will run on commit)
|
|
60
|
+
3. Write tests for new functionality
|
|
61
|
+
4. Run tests: `pytest`
|
|
62
|
+
5. Push and create a Pull Request
|
|
63
|
+
|
|
64
|
+
## Code Standards
|
|
65
|
+
|
|
66
|
+
### Python
|
|
67
|
+
|
|
68
|
+
- Use **ruff** for linting and formatting (automatically enforced by pre-commit)
|
|
69
|
+
- Use **mypy** for static type checking (included in pre-commit)
|
|
70
|
+
- Write unit tests in `tests/` directory
|
|
71
|
+
- Follow PEP 8 style guidelines
|
|
72
|
+
|
|
73
|
+
### YAML/JSON
|
|
74
|
+
|
|
75
|
+
- Validate with pre-commit hooks (automatically enforced)
|
|
76
|
+
- Use 2-space indentation
|
|
77
|
+
|
|
78
|
+
### Commits
|
|
79
|
+
|
|
80
|
+
- Use descriptive commit messages
|
|
81
|
+
- Reference issues when applicable: "Fixes #123"
|
|
82
|
+
- Pre-commit will auto-fix formatting issues before commit
|
|
83
|
+
|
|
84
|
+
## Running Tests
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# All tests
|
|
88
|
+
pytest
|
|
89
|
+
|
|
90
|
+
# With coverage
|
|
91
|
+
pytest --cov=skaal
|
|
92
|
+
|
|
93
|
+
# Specific test file
|
|
94
|
+
pytest tests/solver/test_solver.py
|
|
95
|
+
|
|
96
|
+
# Specific test function
|
|
97
|
+
pytest tests/solver/test_solver.py::test_basic_solver
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Pre-commit Hooks
|
|
101
|
+
|
|
102
|
+
Hooks run automatically on `git commit` and include:
|
|
103
|
+
- **Ruff**: Python linting & formatting
|
|
104
|
+
- **MyPy**: Type checking
|
|
105
|
+
- **YAML/JSON validators**: Format validation
|
|
106
|
+
- **Trailing whitespace**: Auto-fix
|
|
107
|
+
- **Security checks**: Bandit
|
|
108
|
+
|
|
109
|
+
To run manually:
|
|
110
|
+
```bash
|
|
111
|
+
pre-commit run --all-files
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
To skip hooks (not recommended):
|
|
115
|
+
```bash
|
|
116
|
+
git commit --no-verify
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Documentation
|
|
120
|
+
|
|
121
|
+
- Update [LOCAL_DEPLOYMENT.md](LOCAL_DEPLOYMENT.md) if adding deployment features
|
|
122
|
+
- Update docstrings for public APIs
|
|
123
|
+
- Add type hints to new functions
|
|
124
|
+
|
|
125
|
+
## Reporting Bugs
|
|
126
|
+
|
|
127
|
+
Please use GitHub Issues and include:
|
|
128
|
+
- Description of the bug
|
|
129
|
+
- Steps to reproduce
|
|
130
|
+
- Expected behavior
|
|
131
|
+
- Actual behavior
|
|
132
|
+
- OS/Python version info
|
|
133
|
+
|
|
134
|
+
## Feature Requests
|
|
135
|
+
|
|
136
|
+
Use GitHub Issues with:
|
|
137
|
+
- Clear description of the feature
|
|
138
|
+
- Why you think it would be useful
|
|
139
|
+
- Possible implementation approach (optional)
|
|
140
|
+
|
|
141
|
+
## Pull Requests
|
|
142
|
+
|
|
143
|
+
- Clear PR title and description
|
|
144
|
+
- Link to related issues
|
|
145
|
+
- All tests pass
|
|
146
|
+
- Code passes pre-commit checks
|
|
147
|
+
- Documentation updated if needed
|
|
148
|
+
|
|
149
|
+
## Questions?
|
|
150
|
+
|
|
151
|
+
Have questions about contributing? Open an issue or check existing documentation:
|
|
152
|
+
- [PRE_COMMIT_SETUP.md](PRE_COMMIT_SETUP.md) - Pre-commit hook details
|
|
153
|
+
- [LOCAL_DEPLOYMENT.md](LOCAL_DEPLOYMENT.md) - Deployment and testing
|
|
154
|
+
- [pyproject.toml](pyproject.toml) - Project configuration
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
**Thank you for contributing to Skaal!** 🎉
|