Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bump actions/setup-python from 3 to 4 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
64 changes: 32 additions & 32 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
name: Build CI wheels

on:
# Save CI by only running this on release branches or tags.
push:
branches:
- main
- v[0-9]+.[0-9]+.x
tags:
- v*
# Also allow running this action on PRs if requested by applying the
# "Run cibuildwheel" label.
pull_request:
types:
- opened
- synchronize
- reopened
- labeled

jobs:
build_wheels:
if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' && (
(
github.event.action == 'labeled' &&
github.event.label.name == 'Run cibuildwheel'
) ||
contains(github.event.pull_request.labels.*.name, 'Run cibuildwheel')
)
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
min-numpy-version: "1.17.3"
min-numpy-hash: "b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe"
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
MACOSX_DEPLOYMENT_TARGET: "10.12"
strategy:
matrix:
os: [ubuntu-18.04, windows-latest, macos-10.15]
Expand All @@ -27,48 +44,31 @@ jobs:
steps:
- name: Set up QEMU
if: matrix.cibw_archs == 'aarch64'
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.7'

- uses: actions/cache@v2
id: numpy-cache
with:
path: numpy-aarch64-cache/
key: numpy-${{ matrix.cibw_archs }}-cache-${{ env.min-numpy-version }}
python-version: '3.8'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.1.1

- name: Build minimum NumPy for aarch64
if: matrix.cibw_archs == 'aarch64' && steps.numpy-cache.outputs.cache-hit != 'true'
run: |
wget https://files.pythonhosted.org/packages/${{ env.min-numpy-hash }}/numpy-${{ env.min-numpy-version }}.zip
unzip numpy-${{ env.min-numpy-version }}.zip
cd numpy-${{ env.min-numpy-version }}
python -m cibuildwheel --output-dir ../numpy-aarch64-cache
env:
CIBW_BUILD: "cp37-* cp38-*"
CIBW_ARCHS: aarch64

- name: Build wheels for CPython 3.10
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp310-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_BEFORE_BUILD: pip install certifi numpy==1.21.3
CIBW_BEFORE_BUILD: pip install certifi oldest-supported-numpy
MPL_DISABLE_FH4: "yes"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

Expand All @@ -79,36 +79,36 @@ jobs:
CIBW_BUILD: "cp39-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.3
CIBW_BEFORE_BUILD: pip install certifi oldest-supported-numpy
MPL_DISABLE_FH4: "yes"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

- name: Build wheels for CPython
- name: Build wheels for CPython 3.8
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp37-* cp38-*"
CIBW_BUILD: "cp38-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
CIBW_BEFORE_BUILD: pip install certifi; pip install --find-links=numpy-aarch64-cache/ numpy==${{ env.min-numpy-version }}
CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.2
MPL_DISABLE_FH4: "yes"
CIBW_ARCHS: ${{ matrix.cibw_archs }}

- name: Build wheels for PyPy
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "pp37-*"
CIBW_BEFORE_BUILD: pip install certifi numpy==${{ env.min-numpy-version }}
CIBW_BUILD: "pp38-*"
CIBW_BEFORE_BUILD: pip install certifi oldest-supported-numpy
CIBW_ARCHS: ${{ matrix.cibw_archs }}
PIP_USE_FEATURE: in-tree-build
if: matrix.cibw_archs != 'aarch64'
if: false && matrix.cibw_archs != 'aarch64'

- name: Validate that LICENSE files are included in wheels
run: |
python ./ci/check_wheel_licenses.py

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./dist/*.whl
65 changes: 65 additions & 0 deletions .github/workflows/nightlies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Upload nightly wheels to Anaconda Cloud

on:
# Run daily at 1:23 UTC to upload nightly wheels to Anaconda Cloud
schedule:
- cron: '23 1 * * *'
# Run on demand with workflow dispatch
workflow_dispatch:

jobs:
upload_nightly_wheels:
name: Upload nightly wheels to Anaconda Cloud
runs-on: ubuntu-latest
if: github.repository_owner == 'matplotlib'

steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

# c.f. https://github.com/actions/download-artifact/issues/3#issuecomment-1017141067
- name: Download wheel artifacts from last build on 'main'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PROJECT_REPO="matplotlib/matplotlib"
BRANCH="main"
WORKFLOW_NAME="cibuildwheel.yml"
ARTIFACT_NAME="wheels"

gh run --repo "${PROJECT_REPO}" \
list --branch "${BRANCH}" \
--workflow "${WORKFLOW_NAME}" \
--json event,status,databaseId > runs.json
# Filter on 'push' events to main (merged PRs) that have completed
jq --compact-output \
'[ .[] | select(.event == "push") | select(.status == "completed") ]' \
runs.json > pushes.json
# Get id of latest build of wheels
RUN_ID=$(
jq --compact-output \
'sort_by(.databaseId) | reverse | .[0].databaseId' pushes.json
)
gh run --repo "${PROJECT_REPO}" \
download "${RUN_ID}" --name "${ARTIFACT_NAME}"

mkdir dist
mv *.whl dist/
ls -l dist/

- name: Install anaconda-client
run: |
python -m pip install --upgrade pip setuptools wheel
# c.f. https://github.com/Anaconda-Platform/anaconda-client/issues/540
python -m pip install git+https://github.com/Anaconda-Server/anaconda-client@be1e14936a8e947da94d026c990715f0596d7043
python -m pip list

- name: Upload wheels to Anaconda Cloud as nightlies
run: |
anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} upload \
--user scipy-wheels-nightly \
--skip-existing \
dist/matplotlib-*.whl
6 changes: 3 additions & 3 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
name: flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python 3
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: eslint
uses: reviewdog/action-eslint@v1
Expand Down
69 changes: 51 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true

on:
push:
branches-ignore:
- auto-backport-of-pr-[0-9]+
- v[0-9]+.[0-9]+.[0-9x]+-doc
pull_request:
branches-ignore:
- v[0-9]+.[0-9]+.[0-9x]+-doc
schedule:
# 3:47 UTC on Saturdays
- cron: "47 3 * * 6"

env:
NO_AT_BRIDGE: 1 # Necessary for GTK3 interactive test.
Expand All @@ -24,26 +32,22 @@ jobs:
include:
- name-suffix: "(Minimum Versions)"
os: ubuntu-18.04
python-version: 3.7
python-version: 3.8
extra-requirements: '-c requirements/testing/minver.txt'
pyqt5-ver: '==5.8 sip==4.19.7' # oldest versions with a Py3.7 wheel.
pyqt5-ver: '==5.11.2 sip==5.0.0' # oldest versions with a Py3.8 wheel.
delete-font-cache: true
XVFB_RUN: xvfb-run -a
- os: ubuntu-18.04
python-version: 3.7
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
- os: ubuntu-18.04
python-version: 3.8
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
- os: ubuntu-20.04
python-version: 3.9
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
- os: ubuntu-20.04
python-version: '3.10-dev'
python-version: '3.10'
# Re-add this when extra dependencies have wheels.
# extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
Expand All @@ -52,12 +56,12 @@ jobs:
XVFB_RUN: ""

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -114,31 +118,31 @@ jobs:
esac

- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
restore-keys: |
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
restore-keys: |
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
- name: Cache ccache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.ccache
key: ${{ matrix.os }}-py${{ matrix.python-version }}-ccache-${{ hashFiles('src/*') }}
restore-keys: |
${{ matrix.os }}-py${{ matrix.python-version }}-ccache-
- name: Cache Matplotlib
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/matplotlib
Expand All @@ -157,8 +161,8 @@ jobs:

# Install dependencies from PyPI.
python -m pip install --upgrade $PRE \
cycler fonttools kiwisolver numpy packaging pillow pyparsing \
python-dateutil setuptools-scm \
'contourpy>=1.0.1' cycler fonttools kiwisolver numpy packaging \
pillow pyparsing python-dateutil setuptools-scm \
-r requirements/testing/all.txt \
${{ matrix.extra-requirements }}

Expand Down Expand Up @@ -211,6 +215,12 @@ jobs:
echo 'wxPython is available' ||
echo 'wxPython is not available'

- name: Install the nightly dependencies
# Only install the nightly dependencies during the scheduled event
if: ${{ github.event_name == 'schedule' && matrix.name-suffix != '(Minimum Versions)' }}
run: |
python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple --upgrade numpy pandas

- name: Install Matplotlib
run: |
ccache -s
Expand Down Expand Up @@ -261,10 +271,33 @@ jobs:
find . -name '*.gc*' -delete
if: ${{ runner.os != 'macOS' }}
- name: Upload code coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: failure()
with:
name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }} result images"
path: ./result_images

# Separate dependent job to only upload one issue from the matrix of jobs
create-issue:
runs-on: ubuntu-latest
needs: [test]
if: ${{ failure() && github.event_name == 'schedule' }}
name: "Create issue on failure"

steps:
- name: Create issue on failure
uses: imjohnbo/issue-bot@v3
with:
title: "[TST] Upcoming dependency test failures"
body: |
The weekly build with nightly wheels from numpy and pandas
has failed. Check the logs for any updates that need to be
made in matplotlib.
https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

pinned: false
close-previous: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}