Repository: alkaline-ml/pmdarima (language: python)

Issue:
Add support to release aarch64 wheels
Problem
---------
On aarch64, ‘pip install pmdarima’ builds the wheels from source code and then installs it. It requires the user to have a development environment installed on his system. Also, it takes more time to build the wheels than downloading and extracting the wheels from pypi.

Resolution
-----------
On aarch64, ‘pip install pmdarima’ should download the wheels from pypi

@aaronreidsmith, Please let me know your interest in releasing aarch64 wheels. I can help with this.



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml
index 8c8e6bbaf..cf041b508 100644
--- a/.github/workflows/build_and_deploy.yml
+++ b/.github/workflows/build_and_deploy.yml
@@ -141,3 +141,53 @@ jobs:
         env:
           TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
           TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
+
+  build-and-deploy-aarch64:
+    name: 'Build and Deploy (aarch64)'
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310]
+    env:
+      python: /opt/python/${{ matrix.python-version }}/bin/python
+      image: quay.io/pypa/manylinux2014_aarch64
+    defaults:
+      run:
+        shell: bash
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@master
+
+      - name: Setup QEMU
+        uses: docker/setup-qemu-action@v1
+
+      - name: Build and Test
+        run: |
+          chmod +x .github/utils/build_and_test_aarch64.sh
+          docker run --rm \
+            -v ${{ github.workspace }}:/workspace \
+            --workdir=/workspace \
+            ${{ env.image }} \
+            .github/utils/build_and_test_aarch64.sh ${{ env.python }}
+
+      - name: Ensuring VERSION file existis
+        id: version_check  # Need this to refer to output below
+        run: |
+          if [ -f "${GITHUB_WORKSPACE}/pmdarima/VERSION" ]; then
+            echo "VERSION file exists"
+            echo "::set-output name=version_exists::true"
+          else
+            echo "VERSION file does not exist"
+            echo "::set-output name=version_exists::false"
+          fi
+
+      - name: Deploying to PyPI
+        # Only deploy on tags and when VERSION file created
+        if: startsWith(github.ref, 'refs/tags') && success() && steps.version_check.outputs.version_exists == 'true'
+        run: |
+          chmod +x build_tools/github/deploy.sh
+          ./build_tools/github/deploy.sh
+        env:
+          TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
+          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
diff --git a/doc/index.rst b/doc/index.rst
index 43d130502..959107472 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -49,6 +49,7 @@ Other versions
 
 Documentation for other release versions of ``pmdarima``:
 
+* `v1.8.5 <http://alkaline-ml.com/pmdarima/1.8.5>`_
 * `v1.8.4 <http://alkaline-ml.com/pmdarima/1.8.4>`_
 * `v1.8.3 <http://alkaline-ml.com/pmdarima/1.8.3>`_
 * `v1.8.2 <http://alkaline-ml.com/pmdarima/1.8.2>`_
diff --git a/doc/whats_new.rst b/doc/whats_new.rst
index bc9bba230..ff0f77224 100644
--- a/doc/whats_new.rst
+++ b/doc/whats_new.rst
@@ -7,6 +7,11 @@ What's new in pmdarima
 As new releases of pmdarima are pushed out, the following list (introduced in
 v0.8.1) will document the latest features.
 
+`v1.8.6 <http://alkaline-ml.com/pmdarima/1.8.6>`_
+-------------------------------------------------
+
+* Add support for ARM64 architecture. See `#434 <https://github.com/alkaline-ml/pmdarima/issues/434>`_
+
 `v1.8.5 <http://alkaline-ml.com/pmdarima/1.8.5>`_
 -------------------------------------------------
 


Test patch:
diff --git a/.github/utils/build_and_test_aarch64.sh b/.github/utils/build_and_test_aarch64.sh
new file mode 100644
index 000000000..94cd07a95
--- /dev/null
+++ b/.github/utils/build_and_test_aarch64.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+PYTHON=$1
+
+# Set up virtual env
+$PYTHON -m pip install virtualenv
+$PYTHON -m venv .env
+source .env/bin/activate
+
+# Install requirements
+pip install --upgrade pip wheel
+pip install -r build_tools/build_requirements.txt
+pip install -r requirements.txt
+
+# Make our wheel
+make version bdist_wheel
+
+# Audit our wheel
+pip install auditwheel
+for whl in dist/*.whl; do
+    if [[ "$whl" =~ "pmdarima" ]]; then
+        auditwheel repair "$whl" -w dist/ # repair pmdarima wheel and output to dist/
+    fi
+    rm "$whl" # remove original wheel
+done
+
+pip install --pre --no-index --find-links dist/ pmdarima
+
+# Can't be in the top-level directory for import or it will fail
+cd .github
+
+# Testing on aarch64 takes too long, so we simply import the package as a spot test
+# Don't use $PYTHON here because we are in a virtual env
+python -c 'import pmdarima; pmdarima.show_versions()'