Skip to content

Commit

Permalink
Merge pull request #227 from naveen521kk/wheels
Browse files Browse the repository at this point in the history
Build Wheels using Github Actions
  • Loading branch information
tobgu authored Jun 9, 2021
2 parents 97c6309 + adb438f commit 19e426f
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Wheels

on:
push:
release:
types: [created]

jobs:
build_wheels:
name: Build Wheels on ${{ matrix.os }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
# Ensure the wheels build even one fails.
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python: [35, 36, 37, 38, 39]
bitness: [32, 64]
include:
# Run 32 and 64 bit version in parallel for Linux and Windows
- os: windows-latest
bitness: 64
platform_id: win_amd64
- os: windows-latest
bitness: 32
platform_id: win32
- os: ubuntu-latest
bitness: 64
platform_id: manylinux_x86_64
- os: ubuntu-latest
bitness: 32
platform_id: manylinux_i686
- os: macos-latest
bitness: 64
platform_id: macosx_x86_64
exclude:
- os: macos-latest
bitness: 32
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_TEST_REQUIRES: pytest==4.* hypothesis==4.*
CIBW_TEST_COMMAND: "bash {project}/tools/test_wheels.sh {project}"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/cibuildwheel@v1.11.1.post1

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
name: wheels-${{ runner.os }}-${{ matrix.platform_id }}-${{ matrix.python }}

- name: Publish (Release)
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install twine
twine upload wheelhouse/*.whl
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.pyc
*#
*.so
*.pyd
*~
build/
pyrsistent.egg-info/
Expand Down
2 changes: 1 addition & 1 deletion pvectorcmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static PyObject *PVector_repr(PVector *self) {
}


static long PVector_hash(PVector *self) {
static Py_hash_t PVector_hash(PVector *self) {
// Follows the pattern of the tuple hash
long x, y;
Py_ssize_t i;
Expand Down
17 changes: 17 additions & 0 deletions tools/test_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
#test wheels in different directory
set -e
set -x
package=$1

FILE_PATH="`dirname \"$0\"`"
FILE_PATH="`( cd \"$FILE_PATH\" && pwd )`"
if [ -z "$FILE_PATH" ] ; then
exit 1
fi

cd $TMP
cp -r $package/tests mtests
pytest -s mtests
rm -r mtests
cd $FILE_PATH

0 comments on commit 19e426f

Please sign in to comment.