Skip to content

Commit

Permalink
Fix wheels (#629)
Browse files Browse the repository at this point in the history
* convert the rest

* only build abi3 wheels for windows

* build-option isn't what we need now

* try to parallelize this a bit because I'm impatient
  • Loading branch information
reaperhulk committed Sep 13, 2020
1 parent a7265f5 commit c42ddf5
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions .github/workflows/wheel-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ jobs:
name: "Python ${{ matrix.PYTHON }} for manylinux1"
steps:
- run: /opt/python/${{ matrix.PYTHON }}/bin/python -m virtualenv .venv
- name: Downgrade pip, can't remember why
run: .venv/bin/pip install -U pip==10.0.1
- name: Install python dependencies
run: .venv/bin/pip install cffi six
run: .venv/bin/pip install -U pip cffi six
- run: .venv/bin/pip download pynacl==${{ github.event.inputs.version }} --no-deps --no-binary pynacl && tar zxvf PyNaCl*.tar.gz && mkdir tmpwheelhouse

- run: |
REGEX="cp3([0-9])*"
if [[ "${{ matrix.PYTHON }}" =~ $REGEX ]]; then
PY_LIMITED_API="--build-option --py-limited-api=cp3${BASH_REMATCH[1]}"
PY_LIMITED_API="--py-limited-api=cp3${BASH_REMATCH[1]}"
fi
.venv/bin/pip wheel pynacl==${{ github.event.inputs.version }} --no-binary pynacl --no-deps --wheel-dir=tmpwheelhouse $PY_LIMITED_API
cd PyNaCl*
LIBSODIUM_MAKE_ARGS="-j$(nproc)" ../.venv/bin/python setup.py bdist_wheel $PY_LIMITED_API && mv dist/PyNaCl*.whl ../tmpwheelhouse
- run: auditwheel repair tmpwheelhouse/PyNaCl*.whl -w wheelhouse/
- run: .venv/bin/pip install pynacl --no-index -f wheelhouse/
- run: |
Expand Down Expand Up @@ -59,18 +60,18 @@ jobs:
PYTHON_DOWNLOAD_URL: ${{ matrix.PYTHON.DOWNLOAD_URL }}
- run: ${{ matrix.PYTHON.BIN_PATH }} -m pip install -U virtualenv
- run: ${{ matrix.PYTHON.BIN_PATH }} -m virtualenv venv
# Downgrade pip, I can't remember why
- run: venv/bin/pip install -U pip==10.0.1
- run: venv/bin/pip install -U wheel cffi six
- run: venv/bin/pip install -U pip wheel cffi six
- run: venv/bin/pip download pynacl==${{ github.event.inputs.version }} --no-deps --no-binary pynacl && tar zxvf PyNaCl*.tar.gz && mkdir wheelhouse
- name: Build the wheel
run: |
REGEX="3\.([0-9])*"
if [[ "$PYTHON_VERSION" =~ $REGEX ]]; then
PY_LIMITED_API="--build-option --py-limited-api=cp3${BASH_REMATCH[1]}"
PY_LIMITED_API="--py-limited-api=cp3${BASH_REMATCH[1]}"
fi
CFLAGS="-mmacosx-version-min=10.9 -march=core2" \
venv/bin/pip wheel pynacl==${{ github.event.inputs.version }} --wheel-dir=wheelhouse --no-binary pynacl --no-deps $PY_LIMITED_API
cd PyNaCl*
LIBSODIUM_MAKE_ARGS="-j$(sysctl -n hw.ncpu)" CFLAGS="-mmacosx-version-min=10.9 -march=core2" \
../venv/bin/python setup.py bdist_wheel $PY_LIMITED_API && mv dist/PyNaCl*.whl ../wheelhouse
env:
PYTHON_VERSION: ${{ matrix.PYTHON.ABI_VERSION }}
- run: venv/bin/pip install -f wheelhouse --no-index pynacl
Expand All @@ -92,12 +93,7 @@ jobs:
- {ARCH: 'x64', SODIUM_ARCH: 'x64', VS_ARCH: 'amd64'}
PYTHON:
- {VERSION: "2.7", SODIUM_MSVC_VERSION: "v100"}
- {VERSION: "3.5", SODIUM_MSVC_VERSION: "v140"}
- {VERSION: "3.6", SODIUM_MSVC_VERSION: "v140"}
- {VERSION: "3.7", SODIUM_MSVC_VERSION: "v140"}
- {VERSION: "3.8", SODIUM_MSVC_VERSION: "v140"}
- {VERSION: "3.8", SODIUM_MSVC_VERSION: "v140", "USE_ABI3": "true", "ABI_VERSION": "cp36"}
name: "Python ${{ matrix.PYTHON.VERSION }} on Windows ${{ matrix.WINDOWS.ARCH }}"
- {VERSION: "3.8", SODIUM_MSVC_VERSION: "v140", "USE_ABI3": "true", "ABI_VERSION": "cp35"}
name: "${{ matrix.PYTHON.VERSION }} ${{ matrix.WINDOWS.ARCH }} ${{ matrix.PYTHON.ABI_VERSION }}"
steps:
- uses: actions/checkout@master
Expand Down Expand Up @@ -138,16 +134,6 @@ jobs:
PYNACL_SODIUM_STATIC: 1
SODIUM_INSTALL: system
if: matrix.PYTHON.VERSION == '2.7'
- name: Build the wheel (py3 no abi3)
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.WINDOWS.VS_ARCH }}
cd PyNaCl* && python setup.py bdist_wheel && mv dist/PyNaCl*.whl ../wheelhouse
shell: cmd
env:
PYNACL_SODIUM_LIBRARY_NAME: sodium
PYNACL_SODIUM_STATIC: 1
SODIUM_INSTALL: system
if: matrix.PYTHON.VERSION != '2.7' && matrix.PYTHON.USE_ABI3 != 'true'
- name: Build the wheel (py3 abi3)
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.WINDOWS.VS_ARCH }}
Expand All @@ -157,7 +143,7 @@ jobs:
PYNACL_SODIUM_LIBRARY_NAME: sodium
PYNACL_SODIUM_STATIC: 1
SODIUM_INSTALL: system
if: matrix.PYTHON.USE_ABI3 == 'true'
if: matrix.PYTHON.VERSION != '2.7'

- name: Test installing the wheel
run: pip install -f wheelhouse pynacl --no-index
Expand Down

0 comments on commit c42ddf5

Please sign in to comment.