Skip to content
This repository was archived by the owner on Jun 12, 2023. It is now read-only.

Build Wheels with GH Actions #29

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 19 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
110 changes: 110 additions & 0 deletions .github/workflows/pythonwheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Create Platform Wheels

on: [push]

jobs:
manylinux-x86_64-wheel:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- name: Checkout pandas
uses: actions/checkout@master
with:
repository: pandas-dev/pandas
- name: Checkout release repo for build script
uses: actions/checkout@master
with:
path: "pandas-release"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Docker Build
run: |
docker run --rm -e PLAT=manylinux2010_x86_64 -e PYVER=${{ matrix.python-version }} -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/pandas-release/manylinux_build.sh
- name: Install and verify wheel
run: |
python -m pip install numpy pytz python-dateutil
# cd to not install the local unbuilt pandas directory
mkdir temp
cd temp
python -m pip install pandas --no-index -f ../wheelhouse
python -c "import pandas"
cd ..
- name: Upload linux wheel artifact
uses: actions/upload-artifact@v1
with:
name: wheels
path: wheelhouse

macos-wheel:
runs-on: macos-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- name: Checkout pandas
uses: actions/checkout@master
with:
repository: pandas-dev/pandas
- 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 setuptools wheel cython numpy
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's needed to install dependencies, the wheel building step should create an isolated environment with the dependencies listed in pyproject.toml?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe an issue elsewhere, but removing this fails to build:

https://github.com/WillAyd/pandas-release/pull/1/checks?check_run_id=444542968

Copy link
Member

Choose a reason for hiding this comment

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

Ah, maybe I am mistaken and pyproject.toml is only used when using pip commands (like "pip install" when building from source). Sorry about that.

In any case, if installing numpy, you need to install the oldest supported version to have compatible wheels for different numpy versions.

- name: Build wheels
run: |
python setup.py bdist_wheel
- name: Install and verify wheel
run: |
python -m pip install pytz python-dateutil
# cd to not install the local unbuilt pandas directory
mkdir temp
cd temp
python -m pip install pandas --no-index -f ../dist
python -c "import pandas"
cd ..
- name: Upload wheel artifact
uses: actions/upload-artifact@v1
with:
name: wheels
path: dist

windows-wheel:
runs-on: windows-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- name: Checkout pandas
uses: actions/checkout@master
with:
repository: pandas-dev/pandas
- 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 setuptools wheel cython numpy
- name: Build wheels
run: |
python setup.py bdist_wheel
- name: Install and verify wheel
run: |
python -m pip install pytz python-dateutil
# cd to not install the local unbuilt pandas directory
mkdir temp
cd temp
python -m pip install pandas --no-index -f ../dist
python -c "import pandas"
cd ..
- name: Upload wheel artifact
uses: actions/upload-artifact@v1
with:
name: wheels
path: dist
24 changes: 24 additions & 0 deletions manylinux_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh -l

# Some paths require the period, others dont
PYVER2="${PYVER//.}"

# Starting in Python38 the ABI version is no longer required
if [ "$PYVER2" = "37" ] || [ "$PYVER2" = "36" ]
then
ABIVER="m"
else
ABIVER=""
fi

PYLOC=/opt/python/cp${PYVER2}-cp${PYVER2}${ABIVER}

${PYLOC}/bin/python -m pip install --upgrade pip setuptools wheel auditwheel
${PYLOC}/bin/python -m pip install cython numpy

cd /io
${PYLOC}/bin/python setup.py bdist_wheel
# TODO: we can be more prescriptive about the wheel being repaired
for whl in dist/pandas*.whl; do
${PYLOC}/bin/python -m auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/
done