Skip to content

Commit 9a83bb8

Browse files
authored
Add cibuildwheel with Linux AArch64 wheel build support (#2672) (#2854)
1 parent 49ecb9a commit 9a83bb8

File tree

6 files changed

+53
-147
lines changed

6 files changed

+53
-147
lines changed

.github/workflows/build-wheels.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/pypi-cd.yml

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,55 @@ on:
77

88
jobs:
99
build:
10+
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
1011
runs-on: ${{ matrix.os }}
1112
strategy:
1213
fail-fast: false
1314
matrix:
14-
os: [ubuntu-latest, macOS-latest, windows-latest]
15-
python-version: [3.6, 3.7, 3.8, 3.9]
16-
node-version: [14.x]
17-
include:
18-
- { os: ubuntu-latest, python-version: 3.6, python-abis: "cp36-cp36m" }
19-
- { os: ubuntu-latest, python-version: 3.7, python-abis: "cp37-cp37m" }
20-
- { os: ubuntu-latest, python-version: 3.8, python-abis: "cp38-cp38" }
21-
- { os: ubuntu-latest, python-version: 3.9, python-abis: "cp39-cp39" }
22-
- { os: windows-latest, python-version: 3.9, build-static: 1 }
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
arch: [auto]
2317

2418
steps:
2519
- name: Check out code
2620
uses: actions/checkout@v2
2721

28-
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v2
30-
with:
31-
node-version: ${{ matrix.node-version }}
32-
33-
- name: Set up conda ${{ matrix.python-version }}
22+
- name: Build wheels
23+
uses: pypa/cibuildwheel@v2.3.1
3424
env:
35-
PYTHON: ${{ matrix.python-version }}
36-
shell: bash
37-
run: |
38-
source ./ci/install-conda.sh
39-
python -m pip install --upgrade pip setuptools wheel coverage;
25+
CIBW_BEFORE_BUILD: git reset --hard && pip install -r ci/requirements-wheel.txt
26+
CIBW_ARCHS: ${{ matrix.arch }}
27+
CIBW_SKIP: pp* *-musllinux* cp310-* *i686
28+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
4029

41-
- name: Install dependencies
42-
env:
43-
WITH_HADOOP: ${{ matrix.with-hadoop }}
44-
WITH_KUBERNETES: ${{ matrix.with-kubernetes }}
45-
NO_COMMON_TESTS: ${{ matrix.no-common-tests }}
46-
shell: bash
30+
- name: Build source
31+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'auto'}}
4732
run: |
48-
source ./ci/reload-env.sh
49-
export DEFAULT_VENV=$VIRTUAL_ENV
33+
git reset --hard
34+
pip install -r ci/requirements-wheel.txt
35+
python setup.py sdist --formats=gztar --dist-dir=./wheelhouse
5036
51-
if [[ "$PYTHON" =~ "3.9" ]]; then
52-
conda install -n test --quiet --yes -c conda-forge python=$PYTHON pyarrow
53-
fi
54-
55-
pip install numpy scipy cython
56-
pip install -e ".[dev,extra]"
57-
conda list -n test
58-
59-
- name: Deploy packages
60-
if: startsWith(github.ref, 'refs/tags/') && matrix.no-deploy != '1'
37+
- name: Release to pypi
6138
shell: bash
6239
env:
63-
DOCKER_IMAGE: "quay.io/pypa/manylinux1_x86_64"
64-
PYABI: ${{ matrix.python-abis }}
65-
BUILD_STATIC: ${{ matrix.build-static }}
6640
PYPI_PWD: ${{ secrets.PYPI_PASSWORD }}
6741
run: |
68-
source ./ci/reload-env.sh
69-
source ./.github/workflows/upload-packages.sh
42+
if [[ "$GITHUB_REPOSITORY" == "mars-project/mars" ]]; then
43+
PYPI_REPO="https://upload.pypi.org/legacy/"
44+
else
45+
PYPI_REPO="https://test.pypi.org/legacy/"
46+
fi
47+
echo "[distutils]" > ~/.pypirc
48+
echo "index-servers =" >> ~/.pypirc
49+
echo " pypi" >> ~/.pypirc
50+
echo "[pypi]" >> ~/.pypirc
51+
echo "repository=$PYPI_REPO" >> ~/.pypirc
52+
echo "username=pyodps" >> ~/.pypirc
53+
echo "password=$PYPI_PWD" >> ~/.pypirc
54+
python -m pip install twine
55+
python -m twine upload -r pypi --skip-existing wheelhouse/*
56+
57+
- name: Upload artifacts to github
58+
uses: actions/upload-artifact@v1
59+
with:
60+
name: wheels
61+
path: ./wheelhouse

.github/workflows/upload-packages.sh

Lines changed: 0 additions & 74 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*.egg
1111
*.egg-info
1212
dist
13+
wheelhouse
1314
build/
1415
eggs
1516
parts

ci/requirements-wheel.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
numpy==1.14.5; python_version<'3.9'
2-
numpy==1.19.3; python_version>='3.9'
3-
pandas==1.0.4; python_version<'3.9'
4-
pandas==1.1.3; python_version>='3.9'
5-
scipy==1.4.1; python_version<'3.9'
6-
scipy==1.5.4; python_version>='3.9'
7-
cython==0.29.21
1+
oldest-supported-numpy
2+
3+
pandas==1.0.4; python_version<'3.9' and platform_machine!='aarch64'
4+
pandas==1.1.3; python_version<'3.9' and platform_machine=='aarch64'
5+
pandas==1.2.2; python_version>='3.9' and python_version<'3.10'
6+
7+
scipy==1.4.1; python_version<'3.9' and platform_machine!='aarch64'
8+
scipy==1.5.3; python_version<'3.9' and platform_machine=='aarch64'
9+
scipy==1.5.4; python_version>='3.9' and python_version<'3.10'
10+
11+
cython==0.29.26
812
requests>=2.4.0
913
cloudpickle>=1.5.0

mars/serialization/numpy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ def deserialize(self, header: Dict, buffers: List, context: Dict):
6161
if header["pickle"]:
6262
return unpickle_buffers(buffers)
6363

64-
dtype = np.lib.format.descr_to_dtype(header["descr"])
64+
try:
65+
dtype = np.lib.format.descr_to_dtype(header["descr"])
66+
except AttributeError: # pragma: no cover
67+
# for older numpy versions, descr_to_dtype is not implemented
68+
dtype = np.dtype(header["descr"])
69+
6570
dtype_new_order = header["dtype_new_order"]
6671
if dtype_new_order:
6772
dtype = dtype[dtype_new_order]

0 commit comments

Comments
 (0)