Skip to content

Commit 6ffa5cb

Browse files
committed
feat: init
1 parent 37d934f commit 6ffa5cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2298
-1
lines changed

.github/workflows/release.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
env:
9+
MATURIN_VERSION: 1.1.0
10+
PY_ALL: 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9
11+
12+
jobs:
13+
sdist:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.10'
22+
- uses: pyo3/maturin-action@v1
23+
with:
24+
maturin-version: v${{ env.MATURIN_VERSION }}
25+
command: build
26+
args: --release --sdist --interpreter 3.10
27+
target: x64
28+
manylinux: off
29+
container: off
30+
- name: Upload sdist
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: wheels
34+
path: target/wheels/*.tar.gz
35+
36+
wheel-unix:
37+
name: wheel ${{ matrix.platform || matrix.os }}(${{ matrix.target }}) - ${{ matrix.manylinux || 'auto' }}
38+
runs-on: ${{ matrix.os }}-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os: [ubuntu, macos]
43+
target: [x86_64, aarch64]
44+
manylinux: [auto]
45+
include:
46+
- os: ubuntu
47+
platform: linux
48+
- os: macos
49+
interpreter: 3.8 3.9 3.10 3.11 pypy3.9
50+
- os: ubuntu
51+
platform: linux
52+
target: aarch64
53+
container: messense/manylinux_2_24-cross:aarch64
54+
- os: ubuntu
55+
platform: linux
56+
target: x86_64
57+
manylinux: musllinux_1_1
58+
- os: ubuntu
59+
platform: linux
60+
target: aarch64
61+
manylinux: musllinux_1_1
62+
exclude:
63+
- os: windows
64+
target: aarch64
65+
steps:
66+
- uses: actions/checkout@v3
67+
- uses: pyo3/maturin-action@v1
68+
with:
69+
maturin-version: v${{ env.MATURIN_VERSION }}
70+
command: build
71+
args: --release --interpreter ${{ matrix.interpreter || env.PY_ALL }}
72+
target: ${{ matrix.target }}
73+
manylinux: ${{ matrix.manylinux || 'auto' }}
74+
container: ${{ matrix.container }}
75+
- name: Upload wheels
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: wheels
79+
path: target/wheels
80+
81+
wheel-win:
82+
runs-on: windows-latest
83+
env:
84+
PY_ALL: 3.8 3.9 3.10 3.11 C:\hostedtoolcache\windows\PyPy\3.9.17\x86\python3.exe
85+
steps:
86+
- uses: actions/checkout@v3
87+
- uses: actions/setup-python@v4
88+
with:
89+
python-version: pypy3.9
90+
- uses: pyo3/maturin-action@v1
91+
with:
92+
maturin-version: v${{ env.MATURIN_VERSION }}
93+
command: build
94+
args: --release --interpreter ${{ env.PY_ALL }}
95+
target: x86_64
96+
manylinux: auto
97+
- name: Upload wheels
98+
uses: actions/upload-artifact@v3
99+
with:
100+
name: wheels
101+
path: target/wheels
102+
103+
release:
104+
runs-on: ubuntu-latest
105+
needs: [ sdist, wheel-unix, wheel-win ]
106+
steps:
107+
- uses: actions/download-artifact@v3
108+
with:
109+
name: wheels
110+
- uses: actions/setup-python@v4
111+
with:
112+
python-version: '3.10'
113+
- name: Publish to PyPi
114+
env:
115+
TWINE_USERNAME: __token__
116+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
117+
run: |
118+
pip install --upgrade pip twine
119+
twine upload --skip-existing *

.github/workflows/test.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
env:
11+
MATURIN_VERSION: 1.1.0
12+
13+
jobs:
14+
linux:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: [3.8, 3.9, '3.10', '3.11']
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install
28+
run: |
29+
python -m venv .venv
30+
source .venv/bin/activate
31+
pip install maturin==${{ env.MATURIN_VERSION }}
32+
maturin develop --extras=test
33+
- name: Test
34+
run: |
35+
source .venv/bin/activate
36+
py.test -v tests
37+
38+
macos:
39+
runs-on: macos-latest
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
python-version: [3.8, 3.9, '3.10', '3.11']
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Set up Python ${{ matrix.python-version }}
48+
uses: actions/setup-python@v2
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
- name: Install
52+
run: |
53+
python -m venv .venv
54+
source .venv/bin/activate
55+
pip install maturin==${{ env.MATURIN_VERSION }}
56+
maturin develop --extras=test
57+
- name: Test
58+
run: |
59+
source .venv/bin/activate
60+
py.test -v tests
61+
62+
windows:
63+
runs-on: windows-latest
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
python-version: [3.8, 3.9, '3.10', '3.11']
68+
69+
steps:
70+
- uses: actions/checkout@v2
71+
- name: Set up Python ${{ matrix.python-version }}
72+
uses: actions/setup-python@v2
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
- name: Install
76+
run: |
77+
python -m venv venv
78+
venv/Scripts/Activate.ps1
79+
pip install maturin==${{ env.MATURIN_VERSION }} pytest
80+
maturin develop --extras=test
81+
- name: Test
82+
run: |
83+
venv/Scripts/Activate.ps1
84+
py.test -v tests

.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

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
fail_fast: true
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: check-yaml
8+
- id: check-toml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- id: check-added-large-files
12+
exclude: "testdata"
13+
14+
- repo: https://github.com/psf/black
15+
rev: 23.7.0
16+
hooks:
17+
- id: black
18+
19+
- repo: local
20+
hooks:
21+
- id: rust-fmt
22+
name: rust-fmt
23+
description: Check if all files follow the rust-fmt style
24+
# https://github.com/pre-commit-ci/issues/issues/121
25+
entry: rustfmt --check --color always
26+
language: rust
27+
pass_filenames: false

.rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
max_width = 120

0 commit comments

Comments
 (0)