Skip to content

Commit 259d878

Browse files
committed
initial commit
1 parent 7d88607 commit 259d878

23 files changed

Lines changed: 6714 additions & 18 deletions

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- uses: dtolnay/rust-toolchain@stable
25+
26+
- uses: Swatinem/rust-cache@v2
27+
28+
- name: cargo test
29+
run: cargo test --release
30+
31+
- name: Install Python deps
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install maturin pytest pytest-benchmark
35+
pip install git+https://github.com/SynaLinks/synalinks.git
36+
37+
- name: Build and install synaops
38+
run: maturin develop --release
39+
40+
- name: Parity tests
41+
run: pytest bench/test_parity.py -v

.github/workflows/release.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Release
2+
3+
# Triggers on a version tag push (e.g. `git tag v0.1.0 && git push --tags`)
4+
# or manually via the Actions UI.
5+
#
6+
# Requires either:
7+
# - repository secret `PYPI_API_TOKEN` set to a PyPI API token, OR
8+
# - PyPI Trusted Publishing configured for this repo (then drop the env
9+
# block on the `release` job and use id-token: write permissions).
10+
11+
on:
12+
push:
13+
tags: ["v*"]
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
linux:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
target: [x86_64, aarch64]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.11"
31+
- name: Build wheels
32+
uses: PyO3/maturin-action@v1
33+
with:
34+
target: ${{ matrix.target }}
35+
args: --release --out dist --find-interpreter
36+
manylinux: auto
37+
- uses: actions/upload-artifact@v4
38+
with:
39+
name: wheels-linux-${{ matrix.target }}
40+
path: dist
41+
42+
macos:
43+
runs-on: macos-latest
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
target: [x86_64, aarch64]
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: actions/setup-python@v5
51+
with:
52+
python-version: "3.11"
53+
- name: Build wheels
54+
uses: PyO3/maturin-action@v1
55+
with:
56+
target: ${{ matrix.target }}
57+
args: --release --out dist --find-interpreter
58+
- uses: actions/upload-artifact@v4
59+
with:
60+
name: wheels-macos-${{ matrix.target }}
61+
path: dist
62+
63+
windows:
64+
runs-on: windows-latest
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
target: [x64]
69+
steps:
70+
- uses: actions/checkout@v4
71+
- uses: actions/setup-python@v5
72+
with:
73+
python-version: "3.11"
74+
architecture: ${{ matrix.target }}
75+
- name: Build wheels
76+
uses: PyO3/maturin-action@v1
77+
with:
78+
target: ${{ matrix.target }}
79+
args: --release --out dist --find-interpreter
80+
- uses: actions/upload-artifact@v4
81+
with:
82+
name: wheels-windows-${{ matrix.target }}
83+
path: dist
84+
85+
sdist:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
- name: Build sdist
90+
uses: PyO3/maturin-action@v1
91+
with:
92+
command: sdist
93+
args: --out dist
94+
- uses: actions/upload-artifact@v4
95+
with:
96+
name: wheels-sdist
97+
path: dist
98+
99+
release:
100+
name: Publish to PyPI
101+
runs-on: ubuntu-latest
102+
needs: [linux, macos, windows, sdist]
103+
if: startsWith(github.ref, 'refs/tags/')
104+
environment: pypi
105+
steps:
106+
- uses: actions/download-artifact@v4
107+
with:
108+
pattern: wheels-*
109+
path: dist
110+
merge-multiple: true
111+
- name: Publish to PyPI
112+
uses: PyO3/maturin-action@v1
113+
env:
114+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
115+
with:
116+
command: upload
117+
args: --non-interactive --skip-existing dist/*

.gitignore

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,78 @@
1-
# Generated by Cargo
2-
# will have compiled files and executables
3-
debug
4-
target
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
share/python-wheels/
20+
*.egg-info/
21+
.installed.cfg
22+
*.egg
23+
MANIFEST
524

6-
# These are backup files generated by rustfmt
7-
**/*.rs.bk
25+
# Virtual environments
26+
.env
27+
.venv
28+
env/
29+
venv/
30+
ENV/
31+
env.bak/
32+
venv.bak/
33+
34+
# Testing / coverage
35+
.tox/
36+
.nox/
37+
.coverage
38+
.coverage.*
39+
.cache
40+
nosetests.xml
41+
coverage.xml
42+
*.cover
43+
*.py,cover
44+
.hypothesis/
45+
.pytest_cache/
46+
.benchmarks/
47+
.ruff_cache/
48+
.mypy_cache/
49+
.dmypy.json
50+
dmypy.json
51+
.pyre/
52+
.pytype/
53+
54+
# Jupyter
55+
.ipynb_checkpoints
56+
profile_default/
57+
ipython_config.py
858

9-
# MSVC Windows builds of rustc generate these, which store debugging information
59+
# Type checker / tooling
60+
.pdm-python
61+
__pypackages__/
62+
63+
# Rust
64+
target/
65+
**/*.rs.bk
1066
*.pdb
67+
Cargo.lock.bak
1168

12-
# Generated by cargo mutants
13-
# Contains mutation testing data
14-
**/mutants.out*/
69+
# IDE / editor
70+
.idea/
71+
.vscode/
72+
*.swp
73+
*.swo
74+
*~
1575

16-
# RustRover
17-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
18-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
19-
# and can be added to the global gitignore or merged into this file. For a more nuclear
20-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
21-
#.idea/
76+
# OS
77+
.DS_Store
78+
Thumbs.db

0 commit comments

Comments
 (0)