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 manylinux to CI wheels build #406

Merged
merged 37 commits into from
May 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
69c298e
Add manylinux build.
bwoodsend May 6, 2020
0f6afcc
More to trigger action build than to make a change
bwoodsend May 6, 2020
06d4d80
Ubuntu appears to be using an old python
bwoodsend May 6, 2020
a05a3a6
Think this was the issue
bwoodsend May 6, 2020
ef39547
ujson version not being passed on
bwoodsend May 6, 2020
4bc9f1b
Try this to get version instead
bwoodsend May 6, 2020
6eaa240
Add default of for manylinux script. Use that in CI script.
bwoodsend May 6, 2020
3e5937c
Add and switch to new docker build script.
bwoodsend May 6, 2020
f09dc66
Update deploy-macos-windows.yml
bwoodsend May 6, 2020
4e3f8c9
Update deploy-macos-windows.yml
bwoodsend May 6, 2020
e0a6fcc
Update deploy-macos-windows.yml
bwoodsend May 6, 2020
e9b2ec1
Update deploy-macos-windows.yml
bwoodsend May 6, 2020
bb0a528
Update deploy-macos-windows.yml
bwoodsend May 6, 2020
a50a148
Update build-wheels.sh
bwoodsend May 6, 2020
5fc87f9
Clear up a bit.
bwoodsend May 6, 2020
4798669
Knew I'd forget to update the name somewhere
bwoodsend May 6, 2020
68cd7ca
Change this back to what it was before I fiddled with it.
bwoodsend May 6, 2020
430538a
Update .github/workflows/deploy-macos-windows.yml
bwoodsend May 8, 2020
96a76ff
Update .github/workflows/deploy-macos-windows.yml
bwoodsend May 8, 2020
e5d225a
Update .github/workflows/deploy-macos-windows.yml
bwoodsend May 8, 2020
ab608ba
Update .github/workflows/deploy-macos-windows.yml
bwoodsend May 8, 2020
5118d46
Update .github/workflows/deploy-macos-windows.yml
bwoodsend May 8, 2020
6cfcb29
Update scripts/build-manylinux-wheels.sh
bwoodsend May 8, 2020
7b57fb7
Update scripts/build-manylinux-wheels.sh
bwoodsend May 8, 2020
bb0f8ee
Update scripts/build-manylinux-wheels.sh
bwoodsend May 8, 2020
a6be591
Update scripts/build-manylinux-wheels.sh
bwoodsend May 8, 2020
68c6271
Fix line endings back to LF
bwoodsend May 8, 2020
4a411e0
Rename wheel building yml to appropriate name.
bwoodsend May 8, 2020
cefb530
Update scripts/build-manylinux-wheels.sh
bwoodsend May 8, 2020
3ae3849
Update scripts/build-manylinux-wheels.sh
bwoodsend May 8, 2020
be21532
Try without setting permissions in the workflow.
bwoodsend May 8, 2020
971839b
change file permissions and make build-manylinux-wheels.sh executable
bwoodsend May 8, 2020
ac0a8b4
Remove sudo in comment.
bwoodsend May 8, 2020
5248177
Add Cleanup of temp-wheels before populating with new wheels. A few w…
bwoodsend May 8, 2020
d267ec6
`rm` doesn't work with wildcards in linux1
bwoodsend May 8, 2020
7d3a5eb
Linux1 also doesn't handle zero length loops properly
bwoodsend May 8, 2020
4baa204
Disable fail-fast
bwoodsend May 9, 2020
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Deploy macOS Windows
name: Deploy wheels

on:
push:
Expand All @@ -15,37 +15,48 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-latest]
python-version: [3.5, 3.6, 3.7, 3.8]
include:
- os: ubuntu-latest
python-version: 3.8

steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade -q pip pytest wheel setuptools twine

- name: Test with pytest
if: matrix.os != 'ubuntu-latest'
run: |
pip install .
pytest

- name: Build wheel

- name: Build macOS/Windows wheel
if: matrix.os != 'ubuntu-latest'
run: python setup.py -q bdist_wheel


- name: Build Linux wheels
if: matrix.os == 'ubuntu-latest'
run: |
docker run -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/scripts/build-manylinux-wheels.sh
docker run -e PLAT=manylinux1_i686 -v `pwd`:/io quay.io/pypa/manylinux1_i686 /io/scripts/build-manylinux-wheels.sh

- uses: actions/upload-artifact@v2
with:
name: Upload as build artifacts
path: dist/*.whl

- name: Publish package to PyPI
if: github.event.action == 'published'
env:
Expand All @@ -59,4 +70,5 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: |
twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing dist/*.whl
twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing dist/*.whl

37 changes: 37 additions & 0 deletions scripts/build-manylinux-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -e -x

# This is to be run by Docker inside a Docker image.
# You can test it locally on a Linux machine by installing docker and running from this repo's root:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# You can test it locally on a Linux machine by installing docker and running from this repo's root:
# You can test it locally on a Linux machine by installing Docker and running from this repo's root:

# $ docker run -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/scripts/build-manylinux-wheels.sh

# The -e just defines an evironment variable PLAT=[docker name] inside the docker - auditwheel can't detect the docker name automatically.
# The -v gives a directory alias for passing files in and out of the docker. (/io is arbitrary). E.g the setup.py script can be accessed in the docker via /io/setup.py
# quay.io/pypa/manylinux1_x86_64 is the full docker image name. Docker downloads it automatically.
# The last argument is a shell command that the Docker will execute. Filenames must be from the Docker's perspective.

# Wheels are initially generated as you would usually, but put in a temp directory temp-wheels.
# The pip-cache is optional but can speed up local builds having a real permanent pip-cache dir.
mkdir -p /io/pip-cache
mkdir -p /io/temp-wheels

# Clean out any old existing wheels.
find /io/temp-wheels/ -type f -delete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, rm -rf /io/temp-wheels before the mkdir. Either is fine.


for PYBIN in /opt/python/cp3[5678]*/bin; do
"${PYBIN}/pip" install -q -U setuptools wheel pytest --cache-dir /io/pip-cache
(cd /io/ && "${PYBIN}/python" -m pip install .)
(cd /io/ && "${PYBIN}/python" -m pytest)
(cd /io/ && "${PYBIN}/python" setup.py -q bdist_wheel -d /io/temp-wheels)
done

"$PYBIN/pip" install -q auditwheel

# Wheels aren't considered manylinux unless they have been through
# auditwheel. Audited wheels go in /io/dist/.
mkdir -p /io/dist/

for whl in /io/temp-wheels/*.whl; do
auditwheel repair "$whl" --plat $PLAT -w /io/dist/
done