From f0b245f72705e3940bb66f432d3a0b6304c2cbce Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 13:46:08 -0500 Subject: [PATCH] docs: update requirements for build on rtd - Add importlib_metadata dependency for older python versions, which seems to be what is used on RTD. - Split the docs job out of the other style jobs and pin the version of Python to force the use of the separate library in CI builds of docs. - Update the mergify rules accordingly. --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ .mergify.yml | 2 +- docs/requirements.txt | 2 ++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d39c3c..a075696 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,3 +121,30 @@ jobs: - name: Run run: tox -e ${{ matrix.tox-environment }} + + # Test build the docs + docs: + runs-on: ubuntu-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + # Pin this low because RTD doesn't seem to adopt new + # versions quickly and this ensures we don't have a + # dependency problem with importlib.metadata. + python-version: "3.9" + + - name: Install dependencies + run: python -m pip install tox + + - name: Run + run: tox -e docs diff --git a/.mergify.yml b/.mergify.yml index 6b41ced..ad3cb2c 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -54,7 +54,7 @@ pull_request_rules: - name: Automatic merge on approval conditions: - and: - - "check-success=style (docs)" + - "check-success=docs" - "check-success=style (style)" - "check-success=style (pkglint)" - "check-success=Test macOS (3.8)" diff --git a/docs/requirements.txt b/docs/requirements.txt index 0fca33e..1729741 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,5 @@ # sphinxcontrib-bitbucket # sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 sphinx +# We need importlib.metadata, which was added in 3.10. +importlib_metadata;python_version<'3.10'