Update .readthedocs.yml addressing a deprecation (#3535) #5397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
permissions: "read-all" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.7" | |
- name: Check packages | |
run: | | |
python3.7 -m pip install pip setuptools wheel twine rstcheck; | |
python3.7 setup.py sdist bdist_wheel; | |
rstcheck README.rst CHANGES.rst | |
python3.7 -m twine check dist/* | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
os: [macos-13, windows-latest, ubuntu-latest] | |
nox-session: [''] | |
exclude: | |
# actions/setup-python dropped support for 3.6 in Ubuntu 22.04 | |
- python-version: "3.6" | |
os: ubuntu-latest | |
# Python 3.7 does not fully support OpenSSL 3, the default on Ubuntu 22.04 | |
# https://bugs.python.org/issue38820 | |
- python-version: "3.7" | |
os: ubuntu-latest | |
include: | |
- experimental: false | |
- python-version: "2.7" | |
os: ubuntu-latest | |
experimental: false | |
nox-session: '' | |
- python-version: "3.6" | |
os: ubuntu-20.04 | |
experimental: false | |
nox-session: '' | |
- python-version: "3.7" | |
os: ubuntu-20.04 | |
experimental: false | |
nox-session: '' | |
- python-version: "pypy-3.9-v7.3.13" | |
os: ubuntu-latest | |
experimental: false | |
nox-session: test-pypy | |
- python-version: "pypy2.7" | |
os: ubuntu-20.04 | |
experimental: false | |
nox-session: test-pypy | |
- python-version: "2.7" | |
os: ubuntu-latest | |
experimental: false | |
nox-session: google_brotli-2.7 | |
- python-version: "3.x" | |
os: ubuntu-latest | |
experimental: false | |
nox-session: google_brotli-3 | |
- python-version: "2.7" | |
os: ubuntu-latest | |
experimental: false | |
nox-session: app_engine | |
- python-version: 3.14 | |
experimental: true | |
runs-on: ${{ matrix.os }} | |
name: ${{ fromJson('{"macos-13":"macOS","windows-latest":"Windows","ubuntu-20.04":"Ubuntu 20.04","ubuntu-latest":"Ubuntu"}')[matrix.os] }} ${{ matrix.python-version }} ${{ matrix.nox-session}} | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set Up Python - ${{ matrix.python-version }} | |
if: matrix.python-version != '2.7' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
# Unfortunately, actions/setup-python does not support CPython 2.7. | |
- name: Set Up Python - 2.7 | |
if: matrix.python-version == '2.7' | |
run: | | |
sudo apt update | |
sudo apt install python2.7-dev python-is-python3 | |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py | |
sudo python2.7 get-pip.py | |
- name: Set Up Python 3 to run nox | |
if: matrix.python-version == '2.7' || matrix.python-version == 'pypy2.7' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3" | |
- if: matrix.python-version == '2.7' || matrix.python-version == 'pypy2.7' | |
name: Install Dependencies | |
run: python -m pip install --upgrade pip setuptools nox 'virtualenv<20.22.0' | |
- if: matrix.python-version != '2.7' && matrix.python-version != 'pypy2.7' | |
name: Install Dependencies | |
run: python -m pip install --upgrade pip setuptools nox | |
- name: Run Tests | |
# `test_requesting_large_resources_via_ssl` is run separately to avoid timeouts. | |
run: ./ci/run_tests.sh ${{ matrix.nox-session != 'app_engine' && 'test/ -k "not requesting_large_resources_via_ssl"' || '' }} | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
NOX_SESSION: ${{ matrix.nox-session }} | |
- name: Upload Coverage | |
if: ${{ matrix.nox-session != 'unsupported_python2' }} | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: coverage-data-${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.experimental }}-${{ matrix.nox-session }} | |
path: ".coverage.*" | |
if-no-files-found: error | |
include-hidden-files: true | |
# A slow test that needs to be run separatelly to avoid timeouts. | |
test_requesting_large_resources_via_ssl: | |
strategy: | |
fail-fast: false | |
matrix: | |
# 3.8 and 3.9 have a known issue with large SSL requests that we work around: | |
# https://github.com/urllib3/urllib3/pull/3181#issuecomment-1794830698 | |
python-version: ["3.7", "3.8", "3.9", "3.12"] | |
runs-on: ubuntu-latest | |
name: Ubuntu ${{ matrix.python-version }} requesting_large_resources_via_ssl | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set Up Python - ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: python -m pip install --upgrade pip setuptools nox | |
- name: Run Tests | |
run: ./ci/run_tests.sh test/ -k "requesting_large_resources_via_ssl" | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
- name: Upload Coverage | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: coverage-data-${{ matrix.python-version }}-test_requesting_large_resources_via_ssl | |
path: ".coverage.*" | |
if-no-files-found: error | |
include-hidden-files: true | |
coverage: | |
if: always() | |
runs-on: "ubuntu-latest" | |
needs: [test, test_requesting_large_resources_via_ssl] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Use latest Python so it understands all syntax" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: "Install coverage" | |
run: "python -m pip install --upgrade coverage" | |
- name: "Download coverage data" | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage-data-* | |
merge-multiple: true | |
- name: "Combine & check coverage" | |
run: | | |
python -m coverage combine | |
python -m coverage html --skip-covered --skip-empty | |
python -m coverage report --ignore-errors --show-missing --fail-under=100 | |
- name: "Upload report if check failed" | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: coverage-report | |
path: htmlcov | |
if: ${{ failure() }} |