Skip to content

Commit

Permalink
Added Multifernet (aviramha#1)
Browse files Browse the repository at this point in the history
* added bindings for multifernet

* updated workflows

* typing fix

* version change

* new init

* upgraded pyo3
  • Loading branch information
bentheiii authored Aug 9, 2021
1 parent bb87a22 commit 2147b65
Show file tree
Hide file tree
Showing 14 changed files with 480 additions and 443 deletions.
444 changes: 204 additions & 240 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rfernet"
version = "0.1.3"
version = "0.2.0"
authors = ["Aviram Hassan <[email protected]>"]
description = "Fast Fernet bindings for Python"
license = "MIT"
Expand Down
5 changes: 0 additions & 5 deletions ci/azure-linux.yml

This file was deleted.

27 changes: 0 additions & 27 deletions ci/azure-macos.yml

This file was deleted.

111 changes: 0 additions & 111 deletions ci/azure-pipelines.yml

This file was deleted.

23 changes: 0 additions & 23 deletions ci/azure-posix.yml

This file was deleted.

16 changes: 0 additions & 16 deletions ci/azure-sdist.yml

This file was deleted.

3 changes: 0 additions & 3 deletions ci/manylinux1.Dockerfile

This file was deleted.

111 changes: 111 additions & 0 deletions ci/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@

name: Release
on:
workflow_dispatch:
push:
tags:
- '*.*.*'


jobs:
release_manylinux:
name: Release manylinux
runs-on: ubuntu-latest
strategy:
matrix:
python-path: ['cp36-cp36m', 'cp37-cp37m', 'cp38-cp38', 'cp39-cp39', 'cp310-cp310']
container: quay.io/pypa/manylinux_2_24_x86_64:latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: yum install -y libffi libffi-devel openssl openssl-devel
- run: /opt/python/${{ matrix.python-path }}/bin/python -m venv .venv
- run: .venv/bin/pip install -U pip wheel
- run: .venv/bin/pip install -U twine maturin
- run: .venv/bin/pip install -r requirements.txt
- run: .venv/bin/maturin build --no-sdist --release --strip --manylinux 2_24 -i /opt/python/${{ matrix.python-path }}/bin/python --target x86_64-unknown-linux-gnu
- run: .venv/bin/pip install rfernet --no-index -f target/wheels
- run: .venv/bin/pytest
- run: .venv/bin/twine upload --non-interactive --skip-existing target/wheels/*
release_windows:
name: Release windows
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: pip install --user -U pip wheel twine maturin
- run: pip install -r requirements.txt
- run: maturin build --no-sdist --release --strip -i $pythonLocation"python.exe"
- run: pip install rfernet --no-index -f target/wheels
- run: pytest
- run: twine upload --non-interactive --skip-existing target\wheels\*

release_macos:
name: Release macOS
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
runs-on: macos-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: pip install -U pip wheel twine maturin
- run: pip install -r requirements.txt
- run: maturin build --no-sdist --release --strip --manylinux off -i $pythonLocation/python --target x86_64-apple-darwin
- run: pip install rfernet --no-index -f target/wheels
- run: pytest
- run: twine upload --non-interactive --skip-existing target/wheels/*
release_sdist:
name: Release sdist
runs-on: ubuntu-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- run: pip install -U pip wheel twine maturin
- run: pip install -r requirements.txt
- run: maturin sdist
- run: twine upload --non-interactive --skip-existing target/wheels/*
67 changes: 67 additions & 0 deletions ci/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

name: Tests & Linting

jobs:
test:
name: Test Suite
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10.0-rc.1']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: pip install --user -U pip wheel
- run: pip install -r requirements.txt
- run: maturin build --no-sdist --release --strip --manylinux off -i $pythonLocation/python
if: ${{ runner.os != 'Windows' }}
- run: maturin build --no-sdist --release --strip --manylinux off -i $pythonLocation"python.exe"
if: ${{ runner.os == 'Windows' }}
- run: pip install rfernet --no-index -f target/wheels
- run: pytest tests/

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
Loading

0 comments on commit 2147b65

Please sign in to comment.