Skip to content

Commit a773130

Browse files
committed
Initial Commit
0 parents  commit a773130

12 files changed

Lines changed: 1352 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
jobs:
9+
# 1. LINTING & FORMATTING (Fail Fast)
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.11'
17+
- name: Install Python Linters
18+
run: pip install ruff black
19+
- name: Run Python Lint (Ruff)
20+
run: ruff check .
21+
- name: Check Python Formatting (Black)
22+
run: black --check .
23+
- uses: dtolnay/rust-toolchain@stable
24+
with:
25+
components: clippy, rustfmt
26+
- name: Check Rust Formatting
27+
run: cargo fmt -- --check
28+
- name: Run Rust Lint (Clippy)
29+
run: cargo clippy -- -D warnings
30+
31+
# 2. TEST & BUILD (Matrix Strategy)
32+
test:
33+
needs: lint
34+
name: Test on ${{ matrix.os }}
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
matrix:
38+
os: [ubuntu-latest, macos-latest, windows-latest]
39+
python-version: ['3.10', '3.11']
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- uses: actions/setup-python@v5
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
48+
- name: Install build tools
49+
run: pip install maturin pytest
50+
51+
# Check Rust Tests
52+
- name: Run Rust Tests
53+
run: cargo test
54+
55+
# Build & Install Package (Dev Mode)
56+
- name: Build and Install (Dev)
57+
run: maturin develop
58+
59+
# Run Python Tests (using the installed Rust module)
60+
- name: Run Python Tests
61+
run: pytest

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Triggers only on tags like v0.1.0, v1.2.3
7+
8+
permissions:
9+
contents: write # Needed to create GitHub Releases
10+
11+
jobs:
12+
# 1. BUILD WHEELS (Linux, Mac, Windows)
13+
build_wheels:
14+
name: Build wheels on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
19+
# macos-13 = Intel (x86), macos-14 = Apple Silicon (M1/M2)
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Build wheels
29+
uses: PyO3/maturin-action@v1
30+
with:
31+
target: auto
32+
args: --release --out dist
33+
sccache: 'true'
34+
35+
- name: Upload wheels
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: wheels-${{ matrix.os }}
39+
path: dist
40+
41+
# 2. BUILD SOURCE DISTRIBUTION (sdist)
42+
build_sdist:
43+
name: Build source distribution
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Build sdist
48+
uses: PyO3/maturin-action@v1
49+
with:
50+
command: sdist
51+
args: --out dist
52+
- name: Upload sdist
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: wheels-sdist
56+
path: dist
57+
58+
# 3. PUBLISH TO PYPI & GITHUB RELEASE
59+
release:
60+
name: Release
61+
runs-on: ubuntu-latest
62+
needs: [build_wheels, build_sdist]
63+
steps:
64+
- uses: actions/download-artifact@v4
65+
with:
66+
pattern: wheels-*
67+
merge-multiple: true
68+
path: dist
69+
70+
- name: Publish to PyPI
71+
uses: PyO3/maturin-action@v1
72+
env:
73+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
74+
with:
75+
command: upload
76+
args: --non-interactive --skip-existing dist/*
77+
78+
- name: Create GitHub Release
79+
uses: softprops/action-gh-release@v1
80+
with:
81+
files: dist/*
82+
generate_release_notes: true

.gitignore

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/target
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
.pytest_cache/
6+
*.py[cod]
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
.venv/
14+
env/
15+
bin/
16+
build/
17+
develop-eggs/
18+
dist/
19+
eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
include/
26+
man/
27+
venv/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
pip-selfcheck.json
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
45+
# Translations
46+
*.mo
47+
48+
# Mr Developer
49+
.mr.developer.cfg
50+
.project
51+
.pydevproject
52+
53+
# Rope
54+
.ropeproject
55+
56+
# Django stuff:
57+
*.log
58+
*.pot
59+
60+
.DS_Store
61+
62+
# Sphinx documentation
63+
docs/_build/
64+
65+
# PyCharm
66+
.idea/
67+
68+
# VSCode
69+
.vscode/
70+
71+
# Pyenv
72+
.python-version

0 commit comments

Comments
 (0)