Skip to content

Commit 1bb3fd7

Browse files
authored
Rust implementation (#12)
- replaced the c++ implementation with Rust - the package now supplies binary wheels for all the platforms
1 parent 3d292e4 commit 1bb3fd7

File tree

13 files changed

+1060
-3301
lines changed

13 files changed

+1060
-3301
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
name: Build
22
on: [push, pull_request]
33
jobs:
4-
build:
4+
lint:
55
if: github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags')
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
- name: Install latest rust
11+
uses: actions-rs/toolchain@v1
12+
with:
13+
toolchain: stable
14+
override: true
15+
components: clippy
16+
- name: Lint with clippy
17+
uses: actions-rs/cargo@v1
18+
with:
19+
command: clippy
20+
args: --all-targets --all-features
21+
test:
22+
runs-on: ${{ matrix.os }}
23+
needs: lint
724
strategy:
25+
fail-fast: false
826
matrix:
9-
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy3']
27+
python-version: ['3.7', '3.8', '3.9', '3.10']
28+
os: [ubuntu-latest , macos-latest, windows-latest]
1029
steps:
1130
- name: Checkout
1231
uses: actions/checkout@v2
1332
- name: Set up Python ${{ matrix.python-version }}
1433
uses: actions/setup-python@v2
1534
with:
1635
python-version: ${{ matrix.python-version }}
17-
- name: Install Ubuntu packages
18-
run: >-
19-
sudo apt install libidn2-dev;
36+
- name: Run image
37+
uses: abatilo/[email protected]
38+
- name: Install Rust
39+
uses: actions-rs/toolchain@v1
40+
with:
41+
profile: minimal
42+
toolchain: stable
43+
override: true
44+
- name: Install dependencies
45+
run: poetry install
46+
- name: Build Python package
47+
run: poetry run maturin develop
2048
- name: Test
21-
run: >-
22-
python setup.py test
49+
run: poetry run pytest -Werror tests

.github/workflows/deploy.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,45 @@
11
name: Deploy
22
on:
33
release:
4-
types: [published]
4+
types: [released]
55
jobs:
66
deploy:
7-
runs-on: ubuntu-20.04
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
python-version: ['3.7', '3.8', '3.9', '3.10']
12+
os: [ubuntu-latest, macos-latest, windows-latest]
813
steps:
914
- name: Checkout
1015
uses: actions/checkout@v2
11-
- name: Set up Python 3.10
16+
- name: Set up Python ${{ matrix.python-version }}
1217
uses: actions/setup-python@v2
1318
with:
14-
python-version: '3.10'
15-
- name: Build a source tarball
16-
run: >-
17-
python -m pip install --user --upgrade setuptools;
18-
python setup.py sdist;
19-
- name: Publish distribution 📦 to PyPI
20-
uses: pypa/gh-action-pypi-publish@master
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install Rust
21+
uses: actions-rs/toolchain@v1
2122
with:
22-
password: ${{ secrets.pypi_password }}
23+
profile: minimal
24+
toolchain: stable
25+
override: true
26+
- name: Publish Package
27+
if: matrix.os != 'windows-latest'
28+
uses: messense/maturin-action@v1
29+
with:
30+
maturin-version: latest
31+
command: publish
32+
manylinux: 2014
33+
args: --username=__token__ --no-sdist --interpreter=python${{ matrix.python-version }}
34+
env:
35+
MATURIN_PASSWORD: ${{ secrets.pypi_password }}
36+
- name: Publish Package
37+
if: matrix.os == 'windows-latest'
38+
uses: messense/maturin-action@v1
39+
with:
40+
maturin-version: latest
41+
command: publish
42+
manylinux: 2014
43+
args: --username=__token__ --no-sdist --interpreter=python
44+
env:
45+
MATURIN_PASSWORD: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)