From a75a03ca8860e141dfae8160d4046e2a30fbb069 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 08:41:16 -0600 Subject: [PATCH 1/8] just build macosx --- .github/workflows/build-wheels.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index e98e220..c8ab5f0 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -24,9 +24,12 @@ jobs: fail-fast: false matrix: - python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] - os: [ubuntu-latest, macos-latest] - platform: [x64, x32] + #python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] + python-version: [ "3.10" ] + #os: [ubuntu-latest, macos-latest] + os: [macos-latest] + #platform: [x64, x32] + platform: [x64] exclude: - os: macos-latest platform: x32 From 73b88f530fe119c620d3769c6c77bf46d6ca90f8 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 08:44:41 -0600 Subject: [PATCH 2/8] update --- .github/workflows/build-wheels.yml | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index c8ab5f0..5ab6ecf 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -30,31 +30,31 @@ jobs: os: [macos-latest] #platform: [x64, x32] platform: [x64] - exclude: - - os: macos-latest - platform: x32 - include: - - python-version: "3.6" - os: ubuntu-latest - platform: aarch64 - - python-version: "3.7" - os: ubuntu-latest - platform: aarch64 - - python-version: "3.8" - os: ubuntu-latest - platform: aarch64 - - python-version: "3.9" - os: ubuntu-latest - platform: aarch64 - - python-version: "3.10" - os: ubuntu-latest - platform: aarch64 - - python-version: "3.8" - os: macos-latest - platform: x86_64 - - python-version: "3.9" - os: macos-latest - platform: x86_64 +# exclude: +# - os: macos-latest +# platform: x32 +# include: +# - python-version: "3.6" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.7" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.8" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.9" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.10" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.8" +# os: macos-latest +# platform: x86_64 +# - python-version: "3.9" +# os: macos-latest +# platform: x86_64 - python-version: "3.10" os: macos-latest platform: x86_64 From 3f0447d034ab90f73f6d38125cb0540c6bb13596 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 08:47:23 -0600 Subject: [PATCH 3/8] update --- .github/workflows/build-wheels.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 5ab6ecf..5fe2917 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -23,13 +23,15 @@ jobs: strategy: fail-fast: false - matrix: - #python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] - python-version: [ "3.10" ] - #os: [ubuntu-latest, macos-latest] - os: [macos-latest] - #platform: [x64, x32] - platform: [x64] + env: + python-version: "3.10" + os: macos-latest + platform: x86_64 +# env: +# matrix: +# python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] +# os: [ubuntu-latest, macos-latest] +# platform: [x64, x32] # exclude: # - os: macos-latest # platform: x32 @@ -55,9 +57,9 @@ jobs: # - python-version: "3.9" # os: macos-latest # platform: x86_64 - - python-version: "3.10" - os: macos-latest - platform: x86_64 +# - python-version: "3.10" +# os: macos-latest +# platform: x86_64 env: REPO_DIR: netcdf4-python PKG_NAME: netcdf4-python From 0125b97bc4081e2c5c4226e2f17e7eb63abf50d3 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 08:54:34 -0600 Subject: [PATCH 4/8] update --- .github/workflows/build-wheels.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 5fe2917..4a22819 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -24,11 +24,10 @@ jobs: fail-fast: false env: - python-version: "3.10" - os: macos-latest - platform: x86_64 + python-version: "3.10" + os: macos-latest + platform: x86_64 # env: -# matrix: # python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] # os: [ubuntu-latest, macos-latest] # platform: [x64, x32] From 9a4ac87749a93397dd97e918982be2186724bed7 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 08:57:46 -0600 Subject: [PATCH 5/8] update --- .github/workflows/build-wheels.yml | 74 +++++++++++++++--------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 4a22819..4d248a2 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -21,44 +21,44 @@ jobs: run: shell: bash strategy: - fail-fast: false - env: - python-version: "3.10" - os: macos-latest - platform: x86_64 -# env: -# python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] -# os: [ubuntu-latest, macos-latest] -# platform: [x64, x32] -# exclude: -# - os: macos-latest -# platform: x32 -# include: -# - python-version: "3.6" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.7" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.8" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.9" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.10" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.8" -# os: macos-latest -# platform: x86_64 -# - python-version: "3.9" -# os: macos-latest -# platform: x86_64 -# - python-version: "3.10" -# os: macos-latest -# platform: x86_64 + + matrix: + python-version: "3.10" + os: macos-latest + platform: x86_64 +# matrix: +# python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] +# os: [ubuntu-latest, macos-latest] +# platform: [x64, x32] +# exclude: +# - os: macos-latest +# platform: x32 +# include: +# - python-version: "3.6" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.7" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.8" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.9" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.10" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.8" +# os: macos-latest +# platform: x86_64 +# - python-version: "3.9" +# os: macos-latest +# platform: x86_64 +# - python-version: "3.10" +# os: macos-latest +# platform: x86_64 env: REPO_DIR: netcdf4-python PKG_NAME: netcdf4-python From 660f3d574feac1bc61cdd57481e2935f9a322980 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 09:00:29 -0600 Subject: [PATCH 6/8] update again --- .github/workflows/build-wheels.yml | 68 +++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 4d248a2..ef81ca9 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -24,41 +24,41 @@ jobs: fail-fast: false matrix: - python-version: "3.10" - os: macos-latest - platform: x86_64 + python-version: [ "3.10" ] + os: [macos-latest] + platform: [x86_64] # matrix: -# python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] -# os: [ubuntu-latest, macos-latest] -# platform: [x64, x32] -# exclude: -# - os: macos-latest -# platform: x32 -# include: -# - python-version: "3.6" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.7" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.8" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.9" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.10" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.8" -# os: macos-latest -# platform: x86_64 -# - python-version: "3.9" -# os: macos-latest -# platform: x86_64 -# - python-version: "3.10" -# os: macos-latest -# platform: x86_64 +# python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] +# os: [ubuntu-latest, macos-latest] +# platform: [x64, x32] +# exclude: +# - os: macos-latest +# platform: x32 +# include: +# - python-version: "3.6" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.7" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.8" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.9" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.10" +# os: ubuntu-latest +# platform: aarch64 +# - python-version: "3.8" +# os: macos-latest +# platform: x86_64 +# - python-version: "3.9" +# os: macos-latest +# platform: x86_64 +# - python-version: "3.10" +# os: macos-latest +# platform: x86_64 env: REPO_DIR: netcdf4-python PKG_NAME: netcdf4-python From f8c10cb1745d7ccf560d8a0be2b215e847b76ae4 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 09:38:10 -0600 Subject: [PATCH 7/8] split macosx wheel building into separate yml --- ...uild-wheels.yml => build-wheels-linux.yml} | 58 ++++----- .github/workflows/build-wheels-macosx.yml | 113 ++++++++++++++++++ 2 files changed, 133 insertions(+), 38 deletions(-) rename .github/workflows/{build-wheels.yml => build-wheels-linux.yml} (76%) create mode 100644 .github/workflows/build-wheels-macosx.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels-linux.yml similarity index 76% rename from .github/workflows/build-wheels.yml rename to .github/workflows/build-wheels-linux.yml index ef81ca9..91e946c 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels-linux.yml @@ -24,41 +24,26 @@ jobs: fail-fast: false matrix: - python-version: [ "3.10" ] - os: [macos-latest] - platform: [x86_64] -# matrix: -# python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] -# os: [ubuntu-latest, macos-latest] -# platform: [x64, x32] -# exclude: -# - os: macos-latest -# platform: x32 -# include: -# - python-version: "3.6" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.7" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.8" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.9" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.10" -# os: ubuntu-latest -# platform: aarch64 -# - python-version: "3.8" -# os: macos-latest -# platform: x86_64 -# - python-version: "3.9" -# os: macos-latest -# platform: x86_64 -# - python-version: "3.10" -# os: macos-latest -# platform: x86_64 + python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] + os: [ubuntu-latest] + platform: [x64, x32] + include: + - python-version: "3.6" + os: ubuntu-latest + platform: aarch64 + - python-version: "3.7" + os: ubuntu-latest + platform: aarch64 + - python-version: "3.8" + os: ubuntu-latest + platform: aarch64 + - python-version: "3.9" + os: ubuntu-latest + platform: aarch64 + - python-version: "3.10" + os: ubuntu-latest + platform: aarch64 + env: REPO_DIR: netcdf4-python PKG_NAME: netcdf4-python @@ -90,11 +75,8 @@ jobs: run: | if [ "schedule" == "${{ github.event_name }}" ] || [ "master" == "$BUILD_COMMIT" ]; then echo "TOKEN=$SCIPY_WHEELS_NIGHTLY_ACCESS" >> $GITHUB_ENV; else echo "TOKEN=$MULTIBUILD_WHEELS_STAGING_ACCESS" >> $GITHUB_ENV; fi if [ "x32" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; elif [ "aarch64" == "${{ matrix.platform }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; else echo "PLAT=x86_64" >> $GITHUB_ENV; fi - if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi - # make universal2 wheels on macos by cross-compiling - if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "PLAT=universal2" >> $GITHUB_ENV; fi - name: Setup Special Environment variables for Linux AArch64 if: ${{ matrix.platform == 'aarch64' }} diff --git a/.github/workflows/build-wheels-macosx.yml b/.github/workflows/build-wheels-macosx.yml new file mode 100644 index 0000000..00ce388 --- /dev/null +++ b/.github/workflows/build-wheels-macosx.yml @@ -0,0 +1,113 @@ +# This workflow will install Python dependencies, run tests and build +# manylinux wheels for a variety of python versions and architectures. + +name: Build and upload macosx wheels + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + create: + tags: +# schedule: +# - cron: '0 0 * * 0,3' # 2/weekly + +jobs: + build: + + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + + matrix: + python-version: [ "3.8", "3.9","3.10" ] + os: [macos-latest] + platform: [x86_64] + env: + REPO_DIR: netcdf4-python + PKG_NAME: netcdf4-python + MB_ML_VER: 2014 + BUILD_COMMIT: v1.5.8rel + UNICODE_WIDTH: 32 + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_REPO_SLUG: ${{ github.repository }} + TRAVIS_BRANCH: ${{ github.head_ref }} + TRAVIS_PULL_REQUEST: ${{ github.event.number }} + TRAVIS_BUILD_DIR: ${{ github.workspace }} + MULTIBUILD_WHEELS_STAGING_ACCESS: ${{ secrets.MULTIBUILD_WHEELS_STAGING_ACCESS }} + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Setup Environment variables + run: | + if [ "schedule" == "${{ github.event_name }}" ] || [ "master" == "$BUILD_COMMIT" ]; then echo "TOKEN=$SCIPY_WHEELS_NIGHTLY_ACCESS" >> $GITHUB_ENV; else echo "TOKEN=$MULTIBUILD_WHEELS_STAGING_ACCESS" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi + echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV + echo "PLAT=universal2" >> $GITHUB_ENV + + - name: Pin Numpy version + run: | + if [ "$MB_PYTHON_VERSION" == '3.6' ]; then + echo "NP_DEP=$(echo numpy==1.17.3)" >> $GITHUB_ENV; + elif [ "$MB_PYTHON_VERSION" == '3.7' ]; then + echo "NP_DEP=$(echo numpy==1.17.3)" >> $GITHUB_ENV; + elif [ "$MB_PYTHON_VERSION" == '3.8' ]; then + echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV; + elif [ "$MB_PYTHON_VERSION" == '3.9' ]; then + echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV; + elif [ "$MB_PYTHON_VERSION" == '3.10' ]; then + echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV; + else + echo "None of the defined python version, use default" + fi + + - name: Print some Environment variable + run: | + echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}" + echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}" + echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}" + echo "TRAVIS_EVENT_TYPE: ${TRAVIS_EVENT_TYPE}" + echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}" + echo "PLAT: ${PLAT}" + echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}" + + - name: Install VirtualEnv + run: | + python -m pip install --upgrade pip + pip install virtualenv + - name: Build and Install Wheels + run: | + BUILD_DEPENDS="$NP_DEP cython setuptools" + TEST_DEPENDS="$NP_DEP nose cython" + source multibuild/common_utils.sh + source multibuild/travis_steps.sh + echo "------- BEFORE INSTALL --------" + before_install + echo "------- CLEAN CODE --------" + clean_code $REPO_DIR $BUILD_COMMIT + echo "------- BUILD WHEEL --------" + build_wheel $REPO_DIR $PLAT + echo "------- INSTALL_RUN --------" + install_run $PLAT + - name: Upload wheels to release + uses: svenstaro/upload-release-action@v2 + if: github.event_name == 'create' + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ github.workspace }}/wheelhouse/netCDF4*whl + tag: ${{ github.ref }} + overwrite: true + file_glob: true From db0c183c3d26b0733c13eeda2bc64d6495ca6eb7 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Tue, 22 Mar 2022 12:44:06 -0600 Subject: [PATCH 8/8] Update build-wheels-linux.yml --- .github/workflows/build-wheels-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-linux.yml b/.github/workflows/build-wheels-linux.yml index 91e946c..9dbe63f 100644 --- a/.github/workflows/build-wheels-linux.yml +++ b/.github/workflows/build-wheels-linux.yml @@ -81,7 +81,7 @@ jobs: - name: Setup Special Environment variables for Linux AArch64 if: ${{ matrix.platform == 'aarch64' }} run: | - echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_arm64v8)" >> $GITHUB_ENV + echo "DOCKER_TEST_IMAGE=$(echo multibuild/focal_arm64v8)" >> $GITHUB_ENV - name: Pin Numpy version run: |