Skip to content

Commit

Permalink
feat: Add support for Python 3.9 across all backends (#1574)
Browse files Browse the repository at this point in the history
* Add official support for Python 3.9 and add Python 3.9 to CI
   - Required PR #1001 to get Python 3.9 support of TensorFlow and TensorFlow Probability
* Add Python 3.9 support to PyPI metadata
* Update GitHub Actions workflows to use Python 3.9
   - .github/workflows/release_tests.yml will be updated after pyhf v0.6.3 is released
* Update Dockerfile to use python:3.9-slim-bullseye as base image
  • Loading branch information
matthewfeickert authored Sep 2, 2021
1 parent 5247c16 commit 80a27ac
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 20 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8]
python-version: [3.7, 3.8, 3.9]
exclude:
- os: macos-latest
python-version: 3.7
- os: macos-latest
python-version: 3.8

steps:
- uses: actions/checkout@v2
Expand All @@ -37,7 +39,7 @@ jobs:
run: |
python -m pytest -r sx --ignore tests/benchmarks/ --ignore tests/contrib --ignore tests/test_notebooks.py
- name: Report core project coverage with Codecov
if: github.event_name == 'push' && matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'
if: github.event_name == 'push' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -47,13 +49,13 @@ jobs:
run: |
python -m pytest -r sx tests/contrib --mpl --mpl-baseline-path tests/contrib/baseline
- name: Report contrib coverage with Codecov
if: github.event_name == 'push' && matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'
if: github.event_name == 'push' && matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: contrib
- name: Run benchmarks
if: github.event_name == 'schedule' && matrix.python-version == 3.8
if: github.event_name == 'schedule' && matrix.python-version == 3.9
run: |
python -m pytest -r sx --benchmark-sort=mean tests/benchmarks/test_benchmark.py
8 changes: 4 additions & 4 deletions .github/workflows/dependencies-head.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -69,7 +69,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -94,7 +94,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

- name: Install python-build, check-manifest, and twine
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
run: |
git merge --squash "origin/${GITHUB_HEAD_REF}"
git commit -m "${PR_TITLE} (#${PR_NUMBER})"
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install bump2version
run: |
python -m pip install --upgrade pip setuptools wheel
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@
"keywords": "physics fitting numpy scipy tensorflow pytorch jax",
"developmentStatus": "4 - Beta",
"applicationCategory": "Scientific/Engineering, Scientific/Engineering :: Physics",
"programmingLanguage": "Python 3, Python 3.7, Python 3.8, Python Implementation CPython"
"programmingLanguage": "Python 3, Python 3.7, Python 3.8, Python 3.9, Python Implementation CPython"
}
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=python:3.8-slim-bullseye
ARG BASE_IMAGE=python:3.9-slim-bullseye
# hadolint ignore=DL3006
FROM ${BASE_IMAGE} as base

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers =
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython

[options]
Expand Down

0 comments on commit 80a27ac

Please sign in to comment.