diff --git a/Cargo.toml b/Cargo.toml index 5fe3c62..2df9063 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,22 @@ [package] name = "rfernet" -version = "0.1.0" +version = "0.1.3" authors = ["Aviram Hassan "] description = "Fast Fernet bindings for Python" license = "MIT" edition = "2018" keywords = ["fast", "fernet"] +readme = "README.md" include = [ "Cargo.toml", # "CHANGELOG.md", -# "LICENSE", + "LICENSE", "pyproject.toml", -# "README.md", + "README.md", "rust-toolchain", "src/*", -# "test/*.py", + "test/*.py", # "test/requirements.txt", ] @@ -24,11 +25,10 @@ name = "rfernet" crate-type = ["cdylib"] [package.metadata.maturin] -requires-python = ">=3.7" +requires-python = ">=3.6" classifier = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", diff --git a/ci/azure-linux.yml b/ci/azure-linux.yml new file mode 100644 index 0000000..afec202 --- /dev/null +++ b/ci/azure-linux.yml @@ -0,0 +1,5 @@ +steps: +- bash: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly --profile minimal -y + displayName: rustup +- bash: source $HOME/.cargo/env && rustup default nightly + displayName: ensure nightly diff --git a/ci/azure-macos.yml b/ci/azure-macos.yml new file mode 100644 index 0000000..ab40d2c --- /dev/null +++ b/ci/azure-macos.yml @@ -0,0 +1,27 @@ + +parameters: + interpreter: '' + manylinux: '' + target: '' + +steps: +- bash: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly --profile minimal -y + displayName: rustup +- bash: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +- bash: brew update + displayName: Update brew +- bash: brew install openssl@1.1 + displayName: Install OpenSSL with brew +- bash: $(interpreter) -m pip install --user --upgrade pip wheel maturin twine pytest + displayName: build dependencies +- bash: PATH=/Users/runner/.local/bin:$HOME/.cargo/bin:$PATH OPENSSL_STATIC=yes OPENSSL_LIB_DIR=/usr/local/opt/openssl@1.1/lib/ OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include RUSTFLAGS="-C target-feature=+sse2" maturin build --release --strip --manylinux $(manylinux) --interpreter $(interpreter) --target $(target) + displayName: build +- bash: $(interpreter) -m pip install target/wheels/rfernet*.whl + displayName: install +- bash: $(interpreter) -m pytest -vrxXs + displayName: pytest +- bash: $(interpreter) -m twine upload target/wheels/*.whl + displayName: publish + env: + TWINE_PASSWORD: $(TWINE_PASSWORD) + TWINE_USERNAME: $(TWINE_USERNAME) \ No newline at end of file diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml new file mode 100644 index 0000000..3017794 --- /dev/null +++ b/ci/azure-pipelines.yml @@ -0,0 +1,111 @@ +jobs: + +- job: linux_python37_sdist + pool: + vmImage: ubuntu-16.04 + variables: + interpreter: python3.7 + target: x86_64-unknown-linux-gnu + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + addToPath: true + - checkout: self + - template: ./azure-linux.yml + parameters: + dependencies: apt + - template: ./azure-sdist.yml + +- job: manylinux1_python38 + pool: + vmImage: ubuntu-16.04 + container: aviramhassan/manylinux1_gcc:x86_64 + variables: + interpreter: /opt/python/cp38-cp38/bin/python3.8 + manylinux: 1 + path: /opt/python/cp38-cp38/bin:/opt/python/cp38-cp38/lib:/home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + target: x86_64-unknown-linux-gnu + steps: + - checkout: self + - template: ./azure-linux.yml + parameters: + dependencies: apt + - template: ./azure-posix.yml + +- job: manylinux1_python37 + pool: + vmImage: ubuntu-16.04 + container: aviramhassan/manylinux1_gcc:x86_64 + variables: + interpreter: /opt/python/cp37-cp37m/bin/python3.7 + manylinux: 1 + target: x86_64-unknown-linux-gnu + path: /opt/python/cp37-cp37m/bin:/opt/python/cp37-cp37m/lib:/home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + steps: + - checkout: self + - template: ./azure-linux.yml + parameters: + dependencies: apt + - template: ./azure-posix.yml + +- job: manylinux1_python36 + pool: + vmImage: ubuntu-16.04 + container: aviramhassan/manylinux1_gcc:x86_64 + variables: + interpreter: /opt/python/cp36-cp36m/bin/python3.6 + manylinux: 1 + target: x86_64-unknown-linux-gnu + path: /opt/python/cp36-cp36m/bin:/opt/python/cp36-cp36m/lib:/home/vsts_azpcontainer/.local/bin:/home/vsts_azpcontainer/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + steps: + - checkout: self + - template: ./azure-linux.yml + parameters: + dependencies: apt + - template: ./azure-posix.yml + +- job: macos_python38 + pool: + vmImage: xcode9-macos10.13 + variables: + interpreter: python3.8 + manylinux: off + target: x86_64-apple-darwin + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + addToPath: true + - checkout: self + - template: ./azure-macos.yml + +- job: macos_python37 + pool: + vmImage: xcode9-macos10.13 + variables: + interpreter: python3.7 + manylinux: off + target: x86_64-apple-darwin + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + addToPath: true + - checkout: self + - template: ./azure-macos.yml + +- job: macos_python36 + pool: + vmImage: xcode9-macos10.13 + variables: + interpreter: python3.6 + manylinux: off + target: x86_64-apple-darwin + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.6' + addToPath: true + - checkout: self + - template: ./azure-macos.yml diff --git a/ci/azure-posix.yml b/ci/azure-posix.yml new file mode 100644 index 0000000..d762771 --- /dev/null +++ b/ci/azure-posix.yml @@ -0,0 +1,23 @@ +parameters: + interpreter: '' + manylinux: '' + target: '' + +steps: +- bash: $(interpreter) -m pip install virtualenv + displayName: install venv +- bash: $(interpreter) -m virtualenv .venv + displayName: setup venv +- bash: PATH=$(path) .venv/bin/pip install --upgrade pip wheel maturin mypy twine pytest + displayName: build dependencies +- bash: PATH=$HOME/.cargo/bin:$PATH OPENSSL_STATIC=yes OPENSSL_LIB_DIR=/opt/pyca/cryptography/openssl/lib OPENSSL_INCLUDE_DIR=/opt/pyca/cryptography/openssl/include RUSTFLAGS="-C target-feature=+sse2" .venv/bin/maturin build --release --strip --manylinux $(manylinux) --interpreter $(interpreter) --target $(target) + displayName: build +- bash: PATH=$(path) .venv/bin/pip install target/wheels/rfernet*.whl + displayName: install +- bash: .venv/bin/pytest -vrxXs + displayName: pytest +- bash: PATH=$(path) .venv/bin/twine upload target/wheels/*.whl + displayName: publish + env: + TWINE_PASSWORD: $(TWINE_PASSWORD) + TWINE_USERNAME: $(TWINE_USERNAME) diff --git a/ci/azure-sdist.yml b/ci/azure-sdist.yml new file mode 100644 index 0000000..1cf7fe5 --- /dev/null +++ b/ci/azure-sdist.yml @@ -0,0 +1,16 @@ +parameters: + interpreter: '' + target: '' + +steps: +- bash: pip install --upgrade pip wheel twine maturin + displayName: build dependencies +- bash: maturin sdist + displayName: package sdist +- bash: pip install target/wheels/rfernet*.tar.gz + displayName: install +- bash: twine upload target/wheels/*.tar.gz + displayName: publish + env: + TWINE_PASSWORD: $(TWINE_PASSWORD) + TWINE_USERNAME: $(TWINE_USERNAME) diff --git a/pyproject.toml b/pyproject.toml index b434eac..98e80e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] name = "rfernet" -version = "0.1.0" +version = "0.1.3" description = "Fast Fernet bindings for Python" authors = ["Aviram Hassan "] license = "MIT" [tool.poetry.dependencies] -python = "^3.7" +python = "^3.6" [tool.poetry.dev-dependencies] pytest = "^5.3" diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..bf867e0 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly