summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-02-18 07:54:37 +0200
committerGitHub <noreply@github.com>2022-02-18 07:54:37 +0200
commit220861d42dfcff7735c5b312d856926f652a216b (patch)
tree2d4915e6896e20e028ac74e149e1ec2386b8c1d6
parentb62c541463a9c7ed011436311ff6df9408db6651 (diff)
parent39bd45dd006353e40e5e12427a9552e9628000ae (diff)
downloadnumpy-220861d42dfcff7735c5b312d856926f652a216b.tar.gz
Merge pull request #20987 from lithomas1/patch-2
BLD: Try adding aarch64 wheels [wheel build]
-rw-r--r--.github/workflows/wheels.yml32
-rw-r--r--.travis.yml75
-rw-r--r--tools/wheels/upload_wheels.sh46
3 files changed, 122 insertions, 31 deletions
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index 5d1c1f797..21792f529 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -79,6 +79,8 @@ jobs:
python: "pp38"
env:
IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }}
+ IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
+ IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout numpy
uses: actions/checkout@v2
@@ -142,32 +144,16 @@ jobs:
- name: Upload wheels
if: success()
shell: bash
+ env:
+ NUMPY_STAGING_UPLOAD_TOKEN: ${{ secrets.NUMPY_STAGING_UPLOAD_TOKEN }}
+ NUMPY_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}
run: |
+ source tools/wheels/upload_wheels.sh
+ set_upload_vars
# trigger an upload to
# https://anaconda.org/scipy-wheels-nightly/numpy
# for cron jobs or "Run workflow" (restricted to main branch).
- # Tags will upload to
+ # Tags will upload to
# https://anaconda.org/multibuild-wheels-staging/numpy
# The tokens were originally generated at anaconda.org
- if [ "push" == "${{ github.event_name }}" ] && [ "${{ startsWith(github.ref, 'refs/tags/v') }}" ]; then
- echo push and tag event
- ANACONDA_ORG=multibuild-wheels-staging
- TOKEN=${{ secrets.NUMPY_STAGING_UPLOAD_TOKEN }}
- elif [ "schedule" == "${{ github.event_name }}" ] || [ "workflow_dispatch" == "${{ github.event_name }}" ]; then
- echo scheduled or dispatched event
- ANACONDA_ORG=scipy-wheels-nightly
- TOKEN=${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}
- else
- echo non-dispatch event
- fi
- # Now do the upload as needed
- # echo ${PWD}
- if [ -z ${TOKEN} ]; then
- echo no token set, not uploading
- else
- python -m pip install git+https://github.com/Anaconda-Server/anaconda-client
- ls ./wheelhouse/*.whl
- anaconda -t ${TOKEN} upload --no-progress --skip -u ${ANACONDA_ORG} ./wheelhouse/*.whl
- echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
- fi
-
+ upload_wheels
diff --git a/.travis.yml b/.travis.yml
index e12001269..3accda7e4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -44,24 +44,83 @@ jobs:
- NPY_USE_BLAS_ILP64=1
- ATLAS=None
+ # Wheel builders
+ # TODO: de-dup env vars in between steps?
- python: "3.8"
os: linux
arch: arm64
virt: vm
env:
- # use OpenBLAS build, not system ATLAS
- - DOWNLOAD_OPENBLAS=1
- - ATLAS=None
-
+ - CIBW_BUILD: cp38-manylinux_aarch64
+ - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
+ - CIBW_BUILD_VERBOSITY: 3
+ - CIBW_BEFORE_BUILD: "'bash {project}/tools/wheels/cibw_before_build.sh {project}'"
+ - CIBW_BEFORE_TEST: "'pip install -r {project}/test_requirements.txt'"
+ - CIBW_TEST_COMMAND: "'bash {project}/tools/wheels/cibw_test_command.sh {project}'"
+ # Workaround Travis limitations
+ # set each variable separately and use cibw pass env to pass through
+ - CFLAGS: "'-std=c99 -fno-strict-aliasing'"
+ - LDFLAGS: "'-Wl,--strip-debug'"
+ - OPENBLAS64_: /usr/local
+ - RUNNER_OS: Linux
+ - CIBW_ENVIRONMENT_PASS_LINUX: "'CFLAGS LDFLAGS OPENBLAS64_ RUNNER_OS'"
+ install: python3 -m pip install cibuildwheel==2.3.1
+ script: |
+ cibuildwheel --output-dir dist
+ source ./tools/wheels/upload_wheels.sh
+ set_travis_vars
+ set_upload_vars
+ upload_wheels # Will be skipped if not a push/tag/scheduled build
+ - python: "3.9"
+ os: linux
+ arch: arm64
+ virt: vm
+ env:
+ - CIBW_BUILD: cp39-manylinux_aarch64
+ - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
+ - CIBW_BUILD_VERBOSITY: 3
+ - CIBW_BEFORE_BUILD: "'bash {project}/tools/wheels/cibw_before_build.sh {project}'"
+ - CIBW_BEFORE_TEST: "'pip install -r {project}/test_requirements.txt'"
+ - CIBW_TEST_COMMAND: "'bash {project}/tools/wheels/cibw_test_command.sh {project}'"
+ # Workaround Travis limitations
+ # set each variable separately and use cibw pass env to pass through
+ - CFLAGS: "'-std=c99 -fno-strict-aliasing'"
+ - LDFLAGS: "'-Wl,--strip-debug'"
+ - OPENBLAS64_: /usr/local
+ - RUNNER_OS: Linux
+ - CIBW_ENVIRONMENT_PASS_LINUX: "'CFLAGS LDFLAGS OPENBLAS64_ RUNNER_OS'"
+ install: python3 -m pip install cibuildwheel==2.3.1
+ script: |
+ cibuildwheel --output-dir dist
+ source ./tools/wheels/upload_wheels.sh
+ set_travis_vars
+ set_upload_vars
+ upload_wheels # Will be skipped if not a push/tag/scheduled build
- python: "3.10"
os: linux
arch: arm64
virt: vm
env:
- # use OpenBLAS build, not system ATLAS
- - DOWNLOAD_OPENBLAS=1
- - ATLAS=None
-
+ - CIBW_BUILD: cp310-manylinux_aarch64
+ - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
+ - CIBW_BUILD_VERBOSITY: 3
+ - CIBW_BEFORE_BUILD: "'bash {project}/tools/wheels/cibw_before_build.sh {project}'"
+ - CIBW_BEFORE_TEST: "'pip install -r {project}/test_requirements.txt'"
+ - CIBW_TEST_COMMAND: "'bash {project}/tools/wheels/cibw_test_command.sh {project}'"
+ # Workaround Travis limitations
+ # set each variable separately and use cibw pass env to pass through
+ - CFLAGS: "'-std=c99 -fno-strict-aliasing'"
+ - LDFLAGS: "'-Wl,--strip-debug'"
+ - OPENBLAS64_: /usr/local
+ - RUNNER_OS: Linux
+ - CIBW_ENVIRONMENT_PASS_LINUX: "'CFLAGS LDFLAGS OPENBLAS64_ RUNNER_OS'"
+ install: python3 -m pip install cibuildwheel==2.3.1
+ script: |
+ cibuildwheel --output-dir dist
+ source ./tools/wheels/upload_wheels.sh
+ set_travis_vars
+ set_upload_vars
+ upload_wheels # Will be skipped if not a push/tag/scheduled build
before_install:
- ./tools/travis-before-install.sh
diff --git a/tools/wheels/upload_wheels.sh b/tools/wheels/upload_wheels.sh
new file mode 100644
index 000000000..fdd6e7d68
--- /dev/null
+++ b/tools/wheels/upload_wheels.sh
@@ -0,0 +1,46 @@
+set_travis_vars() {
+ # Set env vars
+ echo "TRAVIS_EVENT_TYPE is $TRAVIS_EVENT_TYPE"
+ echo "TRAVIS_TAG is $TRAVIS_TAG"
+ if [[ "$TRAVIS_EVENT_TYPE" == "push" && "$TRAVIS_TAG" == refs/tags/v* ]]; then
+ IS_PUSH="true"
+ else
+ IS_PUSH="false"
+ fi
+ if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
+ IS_SCHEDULE_DISPATCH="true"
+ else
+ IS_SCHEDULE_DISPATCH="false"
+ fi
+}
+set_upload_vars() {
+ echo "IS_PUSH is $IS_PUSH"
+ echo "IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH"
+ if [[ "$IS_PUSH" == "true" ]]; then
+ echo push and tag event
+ export ANACONDA_ORG="multibuild-wheels-staging"
+ export TOKEN="$NUMPY_STAGING_UPLOAD_TOKEN"
+ export ANACONDA_UPLOAD="true"
+ elif [[ "$IS_SCHEDULE_DISPATCH" == "true" ]]; then
+ echo scheduled or dispatched event
+ export ANACONDA_ORG="scipy-wheels-nightly"
+ export TOKEN="$NUMPY_NIGHTLY_UPLOAD_TOKEN"
+ export ANACONDA_UPLOAD="true"
+ else
+ echo non-dispatch event
+ export ANACONDA_UPLOAD="false"
+ fi
+}
+upload_wheels() {
+ echo ${PWD}
+ if [[ ${ANACONDA_UPLOAD} == true ]]; then
+ if [ -z ${TOKEN} ]; then
+ echo no token set, not uploading
+ else
+ python -m pip install git+https://github.com/Anaconda-Server/anaconda-client
+ ls ./wheelhouse/*.whl
+ anaconda -t ${TOKEN} upload --skip -u ${ANACONDA_ORG} ./wheelhouse/*.whl
+ echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
+ fi
+ fi
+}