From 55cbd42583e734877dc65fbc1d52acd76dcc0da0 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 29 May 2024 23:06:01 -0500 Subject: [PATCH 1/5] ci(backport): Update GitHub Actions --- .github/workflows/bump-version.yml | 4 +-- .github/workflows/ci.yml | 38 ++++++++++++++++++------- .github/workflows/dependencies-head.yml | 16 +++++------ .github/workflows/docs.yml | 4 +-- .github/workflows/notebooks.yml | 2 +- .github/workflows/publish-package.yml | 8 +++--- .github/workflows/release_tests.yml | 8 ++++-- 7 files changed, 50 insertions(+), 30 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 22209764cb..4849406e64 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -190,11 +190,11 @@ jobs: echo "steps.script.outputs.old_tag=v${current_tag}" echo "old_tag=v${current_tag}" >> $GITHUB_OUTPUT - - name: Set up Python 3.11 + - name: Set up Python 3.12 if: success() uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install Python dependencies run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d390ed04a0..e985ec6c36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,13 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] include: - os: macos-latest - python-version: '3.11' + python-version: '3.12' + # Intel runner + - os: macos-13 + python-version: '3.12' steps: - uses: actions/checkout@v4 @@ -68,34 +71,47 @@ jobs: if: >- github.event_name != 'schedule' && matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: + fail_ci_if_error: true files: ./coverage.xml flags: unittests-${{ matrix.python-version }} + token: ${{ secrets.CODECOV_TOKEN }} - name: Test Contrib module with pytest run: | pytest tests/contrib --mpl --mpl-baseline-path tests/contrib/baseline - name: Report contrib coverage with Codecov - if: github.event_name != 'schedule' && matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v3 + if: github.event_name != 'schedule' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v4 with: + fail_ci_if_error: true files: ./coverage.xml flags: contrib + token: ${{ secrets.CODECOV_TOKEN }} - name: Test docstring examples with doctest - if: matrix.python-version == '3.11' - run: pytest src/ README.rst + # TODO: Don't currently try to match amd64 and arm64 floating point for docs, but will in the future. + if: matrix.python-version == '3.12' && matrix.os != 'macos-latest' + run: coverage run --data-file=.coverage-doctest --module pytest src/ README.rst + + - name: Coverage report for doctest only + if: matrix.python-version == '3.12' && matrix.os != 'macos-latest' + run: | + coverage report --data-file=.coverage-doctest + coverage xml --data-file=.coverage-doctest -o doctest-coverage.xml - name: Report doctest coverage with Codecov - if: github.event_name != 'schedule' && matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v3 + if: github.event_name != 'schedule' && matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v4 with: - files: ./coverage.xml + fail_ci_if_error: true + files: doctest-coverage.xml flags: doctest + token: ${{ secrets.CODECOV_TOKEN }} - name: Run benchmarks - if: github.event_name == 'schedule' && matrix.python-version == '3.11' + if: github.event_name == 'schedule' && matrix.python-version == '3.12' run: | pytest --benchmark-sort=mean tests/benchmarks/test_benchmark.py diff --git a/.github/workflows/dependencies-head.yml b/.github/workflows/dependencies-head.yml index 405069a942..d6f7a43421 100644 --- a/.github/workflows/dependencies-head.yml +++ b/.github/workflows/dependencies-head.yml @@ -16,8 +16,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] - python-version: ['3.10'] + os: [ubuntu-latest, macos-latest, macos-13] + python-version: ['3.12'] steps: - uses: actions/checkout@v4 @@ -43,7 +43,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.10'] + python-version: ['3.12'] steps: - uses: actions/checkout@v4 @@ -73,7 +73,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.10'] + python-version: ['3.12'] steps: - uses: actions/checkout@v4 @@ -93,13 +93,13 @@ jobs: run: | pytest --ignore tests/benchmarks/ --ignore tests/contrib --ignore tests/test_notebooks.py - uproot4: + uproot5: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] - python-version: ['3.10'] + python-version: ['3.12'] steps: - uses: actions/checkout@v4 @@ -124,7 +124,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.10'] + python-version: ['3.12'] steps: - uses: actions/checkout@v4 @@ -160,7 +160,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.10'] + python-version: ['3.12'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e5b04d2011..70c841ef21 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install Python dependencies run: | @@ -116,7 +116,7 @@ jobs: steps: - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@v5 - name: Deploy to GitHub Pages id: deployment diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index 12cfc7f2aa..ca9a5eb609 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10'] + python-version: ['3.12'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index ac2068c20e..a70a9e1478 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -34,10 +34,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install python-build and twine run: | @@ -130,13 +130,13 @@ jobs: if: >- (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'scikit-hep/pyhf') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' && github.repository == 'scikit-hep/pyhf') - uses: pypa/gh-action-pypi-publish@v1.8.11 + uses: pypa/gh-action-pypi-publish@v1.8.14 with: repository-url: https://test.pypi.org/legacy/ print-hash: true - name: Publish distribution 📦 to PyPI if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'scikit-hep/pyhf' - uses: pypa/gh-action-pypi-publish@v1.8.11 + uses: pypa/gh-action-pypi-publish@v1.8.14 with: print-hash: true diff --git a/.github/workflows/release_tests.yml b/.github/workflows/release_tests.yml index ac074e55a5..146fb4cd4d 100644 --- a/.github/workflows/release_tests.yml +++ b/.github/workflows/release_tests.yml @@ -18,10 +18,14 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] include: - os: macos-latest - python-version: '3.10' + python-version: '3.12' + # Intel runner + - os: macos-13 + python-version: '3.12' + fail-fast: false steps: - uses: actions/checkout@v4 From 14a8945550e5b3c407a208569c5bf59e2bd9c25e Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 29 May 2024 23:34:14 -0500 Subject: [PATCH 2/5] Add python 3.7 back in --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e985ec6c36..a1e016e307 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] include: - os: macos-latest python-version: '3.12' From 25ea66fb54bf9cad5162e83384d6a0db88082273 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 29 May 2024 23:36:56 -0500 Subject: [PATCH 3/5] Add python 3.12 as needed in pyproject.toml --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 279dc41250..9c9cc3cf18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Physics", @@ -108,8 +109,8 @@ test = [ "pytest-mpl", "ipympl>=0.3.0", "pydocstyle", - "papermill~=2.3.4", - "scrapbook~=0.5.0", + "papermill>=2.5.0", + "scrapbook>=0.5.0", "jupyter", "graphviz", "pytest-socket>=0.2.0", # c.f. PR #1917 @@ -236,7 +237,7 @@ filterwarnings = [ [tool.mypy] files = "src" -python_version = "3.11" +python_version = "3.12" warn_unused_configs = true strict = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] From e47ef065728db20cee3fbfaceb8928da3a4c2e7a Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 29 May 2024 23:39:58 -0500 Subject: [PATCH 4/5] lower bounds for all --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9c9cc3cf18..8b63271e90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,14 +118,14 @@ test = [ docs = [ "pyhf[xmlio,contrib]", "sphinx>=7.0.0", # c.f. https://github.com/scikit-hep/pyhf/pull/2271 - "sphinxcontrib-bibtex~=2.1", + "sphinxcontrib-bibtex>=2.1", "sphinx-click", "sphinx-rtd-theme>=1.3.0", # c.f. https://github.com/scikit-hep/pyhf/pull/2271 "nbsphinx!=0.8.8", # c.f. https://github.com/spatialaudio/nbsphinx/issues/620 "ipywidgets", "sphinx-issues", "sphinx-copybutton>=0.3.2,!=0.5.1", - "jupyterlite-sphinx>=0.8.0", + "jupyterlite-sphinx>=0.13.1", # c.f. https://github.com/scikit-hep/pyhf/pull/2458 "jupyterlite-pyodide-kernel>=0.0.7", "jupytext>=1.14.0", "ipython!=8.7.0", # c.f. https://github.com/scikit-hep/pyhf/pull/2068 From ea4b8321d18aff20d2d095c28aa08741b24be9fd Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 29 May 2024 23:47:23 -0500 Subject: [PATCH 5/5] Loosen lower bound on papermill --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8b63271e90..0accce7426 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,7 @@ test = [ "pytest-mpl", "ipympl>=0.3.0", "pydocstyle", - "papermill>=2.5.0", + "papermill>=2.3.4", "scrapbook>=0.5.0", "jupyter", "graphviz",