From 0a41f63320face2167b952171c096cdb4c44a591 Mon Sep 17 00:00:00 2001 From: mferrera Date: Fri, 16 Jun 2023 07:45:39 +0200 Subject: [PATCH 1/2] Build Sphinx without setuptools hook --- .github/workflows/subscript.yml | 17 +++++++---------- docs/contribution.rst | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/subscript.yml b/.github/workflows/subscript.yml index 50c7ca69b..2cae15d32 100644 --- a/.github/workflows/subscript.yml +++ b/.github/workflows/subscript.yml @@ -26,15 +26,12 @@ jobs: steps: - name: Checkout commit locally - uses: actions/checkout@v2 - - - name: Checkout tags - # This seems necessary for setuptools_scm to be able to infer - # the correct version. - run: git fetch --unshallow --tags - + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -78,12 +75,12 @@ jobs: run: rstcheck -r docs - name: Build documentation - run: python setup.py build_sphinx + run: sphinx-build -b html docs build/docs/html - name: Update GitHub pages if: github.repository_owner == 'equinor' && github.ref == 'refs/heads/master' && matrix.python-version == '3.8' run: | - cp -R ./build/sphinx/html ../html + cp -R ./build/docs/html ../html git config --local user.email "subscript-github-action" git config --local user.name "subscript-github-action" diff --git a/docs/contribution.rst b/docs/contribution.rst index a708196ff..aa3395456 100644 --- a/docs/contribution.rst +++ b/docs/contribution.rst @@ -144,6 +144,6 @@ Building documentation Assuming the developer instructions above, run the following command to to build the documentation for subscript:: - python setup.py build_sphinx + sphinx-build -b html docs build/docs/html and then point your browser to the file ``build/docs/index.html``. From 318e4d4c8ff80ff13766e815b9e0d7aa67f5b841 Mon Sep 17 00:00:00 2001 From: mferrera Date: Fri, 16 Jun 2023 08:08:56 +0200 Subject: [PATCH 2/2] Pin sphinx<7 Sphinx 7 deprecates the usage of the `style` HTML key in templates and the sphinx_rtd_theme package has not yet been updated to address this change. --- docs_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs_requirements.txt b/docs_requirements.txt index 231b26fd5..acf9fea6c 100644 --- a/docs_requirements.txt +++ b/docs_requirements.txt @@ -1,5 +1,5 @@ autoapi -sphinx +sphinx<7 sphinx-argparse sphinx-autodoc-typehints sphinx_rtd_theme