Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github action to build and publish wheels #517

Merged
merged 21 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azurePipeline/cibuildwheel_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
steps:
- bash: |
python3 -m pip install --upgrade pip
pip3 install cibuildwheel==1.7.1
pip3 install cibuildwheel==2.3.1
cibuildwheel --print-build-identifiers
cibuildwheel --output-dir wheelhouse .
displayName: Build Wheel
Expand Down
6 changes: 3 additions & 3 deletions .azurePipeline/unittest_wheel_steps.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
pythonVersion: '3.7'
operatingSystem: 'ubuntu-16.04'
artifactName: 'wheels.linux37'
pythonVersion: '3.9'
operatingSystem: 'ubuntu-20.04'
artifactName: 'wheels.linux39'
artifactPattern: '**/*.whl'

steps:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and upload to PyPI

on:
release:
types: [ published ]
push:
branches:
- 'main'

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
# to supply options, put them in 'env', like:
env:
CIBW_SKIP: '*-win32 *i686'

- uses: actions/upload-artifact@v3
with:
name: binary-wheels
path: ./wheelhouse/*.whl
hardbyte marked this conversation as resolved.
Show resolved Hide resolved

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
name: binary-wheels
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest

# upload to PyPI on every tag starting with "v"
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: binary-wheels
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
python: ["3.7", "3.8", "3.9"]
python: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -41,7 +41,7 @@ jobs:
run: |
pytest -q
- name: Test with extended size 100k
if: ${{ matrix.python == 3.9}}
if: ${{ matrix.python == 3.10}}
env:
INCLUDE_100K: 1
run: |
Expand Down
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
new version
===========

- Process chunk now utilizes the ``find_candidate_pairs`` function and can optionally pass on a blocking function. #462
- Added support for Python 3.10 and updated various test dependencies. #517
- Switch from Travis-CI to Github Actions #467
- Switch back to using upstream `bitarray` now they distribute binary wheels. #517


0.14.2
======

Expand Down
56 changes: 30 additions & 26 deletions azurePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,26 @@ stages:
displayName: Build Wheel Packages
variables:
# Need to install development libraries for manylinux container
CIBW_BEFORE_BUILD_LINUX: 'yum install -y libffi-devel atlas-devel'
CIBW_BEFORE_ALL_LINUX: 'yum install -y libffi-devel atlas-devel'
# Only build for Python36+, and x64 arch
CIBW_BUILD: 'cp39-* cp38-* cp37-* cp36-*'
CIBW_SKIP: '*-win32 *-manylinux_i686'
CIBW_BUILD: 'cp310-* cp39-* cp38-* cp37-* cp36-*'
CIBW_SKIP: '*-win32 *-manylinux_i686 *-musllinux_*'
#CIBW_BEFORE_TEST: pip install -r {project}/requirements.txt
#CIBW_TEST_COMMAND: "pytest {project}/tests"
jobs:
- job: linux_310
displayName: Linux + Python3.10
pool:
vmImage: 'ubuntu-20.04'
variables:
CIBW_BUILD: 'cp310-*'
steps:
- { task: UsePythonVersion@0, inputs: { versionSpec: '3.10', architecture: x64 } }
- template: .azurePipeline/cibuildwheel_steps.yml
- job: linux_39
displayName: Linux + Python3.9
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
variables:
CIBW_BUILD: 'cp39-*'
steps:
Expand All @@ -28,7 +39,7 @@ stages:
- job: linux_38
displayName: Linux + Python3.8
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
variables:
CIBW_BUILD: 'cp38-*'
steps:
Expand All @@ -37,7 +48,7 @@ stages:
- job: linux_37
displayName: Linux + Python3.7
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
variables:
CIBW_BUILD: 'cp37-*'
steps:
Expand All @@ -46,7 +57,7 @@ stages:
- job: linux_36
displayName: Linux + Python3.6
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
variables:
CIBW_BUILD: 'cp36-*'
steps:
Expand All @@ -55,9 +66,9 @@ stages:
- job: macos
displayName: MacOS
pool:
vmImage: 'macOS-10.14'
vmImage: 'macOS-10.15'
variables:
MACOSX_DEPLOYMENT_TARGET: '10.14'
MACOSX_DEPLOYMENT_TARGET: '10.15'
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
Expand All @@ -67,7 +78,7 @@ stages:
- job: windows
displayName: Windows
pool:
vmImage: 'vs2017-win2016'
vmImage: 'windows-2019'
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
Expand All @@ -82,7 +93,7 @@ stages:
- job: sdist
displayName: build source distribution
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
steps:
- task: UsePythonVersion@0
inputs:
Expand All @@ -105,7 +116,7 @@ stages:
- job:
displayName: Linux
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
strategy:
matrix:
Python3.6:
Expand All @@ -125,11 +136,11 @@ stages:
parameters:
artifactName: $(artifactName)
pythonVersion: $(pythonVersion)
operatingSystem: 'ubuntu-18.04'
operatingSystem: 'ubuntu-20.04'
- job:
displayName: MacOS
pool:
vmImage: 'macOS-10.14'
vmImage: 'macOS-10.15'
strategy:
matrix:
Python3.7:
Expand All @@ -150,11 +161,11 @@ stages:
artifactName: $(artifactName)
artifactPattern: $(artifactPattern)
pythonVersion: $(pythonVersion)
operatingSystem: 'macOS-10.14'
operatingSystem: 'macOS-10.15'
- job:
displayName: Windows
pool:
vmImage: 'vs2017-win2016'
vmImage: 'windows-2019'
strategy:
matrix:
Python3.6:
Expand All @@ -179,7 +190,7 @@ stages:
artifactName: $(artifactName)
artifactPattern: $(artifactPattern)
pythonVersion: $(pythonVersion)
operatingSystem: 'vs2017-win2016'
operatingSystem: 'windows-2019'

- stage: static_checks
displayName: Static Checks
Expand All @@ -188,21 +199,14 @@ stages:
- job:
displayName: Typecheck
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
versionSpec: '3.9'
- script: pip install -U mypy types-setuptools
- script: mypy anonlink --ignore-missing-imports
displayName: mypy
- job:
displayName: "check for and tag release"
steps:
# In this step, if this build is triggered by a tag, it will add a tag 'doRelease' to the current build.
# This tag in turn is used as a trigger for the release pipeline.
- script: echo "##vso[build.addbuildtag]doRelease"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')

- stage: publish
displayName: Publish packages to test feed
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ bitarray==2.4.0
clkhash==0.16.1
Cython==0.29.23
hypothesis==6.9.2
pytest==6.2.3
pytest-cov==2.11.1
numpy==1.20.2; python_version >= '3.7'
numpy==1.19.5; python_version < '3.7'
pytest>=7.0.1
pytest-cov==3.0.0
numpy==1.22.2; python_version >= '3.8'
numpy==1.19.5; python_version < '3.8'
mypy-extensions==0.4.3
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
here = os.path.abspath(os.path.dirname(__file__))

requirements = [
"bitarray-hardbyte>=0.8.0",
"numpy>=1.14",
"bitarray>=2.4.0",
"numpy>=1.19",
"mypy-extensions>=0.4",
"Cython>=0.29.10"
]
Expand All @@ -28,7 +28,7 @@
"pytest-cov",
"codecov",
"hypothesis",
"clkhash>=0.15.0",
"clkhash>=0.16.1",
]

current_os = platform.system()
Expand Down Expand Up @@ -100,6 +100,7 @@
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Security :: Cryptography",
Expand Down
35 changes: 0 additions & 35 deletions travis/build-dist.sh

This file was deleted.