From 99a9608ceed5ab3ce7c17c62790ef7c07da0fa2e Mon Sep 17 00:00:00 2001 From: Conor MacBride Date: Fri, 31 Mar 2023 13:02:57 +0100 Subject: [PATCH 1/5] Add RTD config --- .github/workflows/docs.yml | 58 -------------------------------------- .readthedocs.yaml | 26 +++++++++++++++++ docs/rtd_environment.yaml | 8 ++++++ docs/sample_summaries.py | 2 +- setup.cfg | 1 + 5 files changed, 36 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/docs.yml create mode 100644 .readthedocs.yaml create mode 100644 docs/rtd_environment.yaml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index ea24f417..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Docs - -on: - push: - branches: - - main - tags: - - v[0-9]+.[0-9]+.[0-9]+ - pull_request: - -permissions: - contents: write - -concurrency: - group: ${{ github.workflow}}-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - run: python -m pip install pip --upgrade - - run: python -m pip install -e ".[test,docs]" - - run: | - cd docs - make html - - uses: actions/upload-artifact@v3 - with: - name: docs-html - path: | - docs/_build/html - retention-days: 5 - - deploy: - if: ${{ github.event_name != 'pull_request' }} - needs: [build] - environment: - name: github-pages - runs-on: ubuntu-latest - steps: - - name: Download doc build - uses: actions/download-artifact@v3 - with: - name: docs-html - path: ./docs/_build/html - - name: Upload to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/_build/html - exclude_assets: '.buildinfo,_static/jquery-*.js,_static/underscore-*.js' - destination_dir: ./latest - keep_files: false - full_commit_message: Deploy latest to GitHub Pages diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..c5c61c32 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,26 @@ +version: 2 + +build: + os: "ubuntu-22.04" + tools: + python: "mambaforge-4.10" + +conda: + environment: docs/rtd_environment.yaml + +sphinx: + builder: html + configuration: docs/conf.py + +# Install regular dependencies. +# Then, install special pinning for RTD. +python: + system_packages: false + install: + - method: pip + path: . + extra_requirements: + - docs + +# Don't build any extra formats +formats: [] diff --git a/docs/rtd_environment.yaml b/docs/rtd_environment.yaml new file mode 100644 index 00000000..3e133fe5 --- /dev/null +++ b/docs/rtd_environment.yaml @@ -0,0 +1,8 @@ +name: rtd311 +channels: + - conda-forge + - defaults +dependencies: + - python=3.11 + - pip + - graphviz diff --git a/docs/sample_summaries.py b/docs/sample_summaries.py index 0c4f9d8d..c1114fb0 100644 --- a/docs/sample_summaries.py +++ b/docs/sample_summaries.py @@ -36,7 +36,7 @@ def run_pytest(test_name): lambda x: x.name[:-1] in test_name, pathlib.Path(tmp_dir).glob("*0") )) / "results" - os.replace(src, dest) + shutil.copytree(src, dest) return dest diff --git a/setup.cfg b/setup.cfg index 3a33a977..7f9a3e3c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,6 +43,7 @@ docs = sphinx mpl_sphinx_theme>=3.6.0.dev0 sphinx_design + matplotlib==3.6 [tool:pytest] testpaths = tests From ff6766e2e559c80dc3085741793ecaa15d7315bf Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Sat, 1 Apr 2023 10:59:07 +0100 Subject: [PATCH 2/5] Simplify RTD config --- .readthedocs.yaml | 7 ------- docs/rtd_environment.yaml | 8 -------- 2 files changed, 15 deletions(-) delete mode 100644 docs/rtd_environment.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c5c61c32..1e0325dc 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -2,18 +2,11 @@ version: 2 build: os: "ubuntu-22.04" - tools: - python: "mambaforge-4.10" - -conda: - environment: docs/rtd_environment.yaml sphinx: builder: html configuration: docs/conf.py -# Install regular dependencies. -# Then, install special pinning for RTD. python: system_packages: false install: diff --git a/docs/rtd_environment.yaml b/docs/rtd_environment.yaml deleted file mode 100644 index 3e133fe5..00000000 --- a/docs/rtd_environment.yaml +++ /dev/null @@ -1,8 +0,0 @@ -name: rtd311 -channels: - - conda-forge - - defaults -dependencies: - - python=3.11 - - pip - - graphviz From 68cfe1699e81fe4a00cd034eac2608a57fcac403 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Sat, 1 Apr 2023 11:00:30 +0100 Subject: [PATCH 3/5] Remove sphinx: section as it should be the default behavior --- .readthedocs.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1e0325dc..8edfe537 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,10 +3,6 @@ version: 2 build: os: "ubuntu-22.04" -sphinx: - builder: html - configuration: docs/conf.py - python: system_packages: false install: From 82aaeb48634dacdca25d8177100004af2a58cc93 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Sat, 1 Apr 2023 11:02:12 +0100 Subject: [PATCH 4/5] Specify Python version --- .readthedocs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 8edfe537..e2650820 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -2,6 +2,8 @@ version: 2 build: os: "ubuntu-22.04" + tools: + python: "3.11" python: system_packages: false From 64ca91f501aef611e71f614decd99b5f6f2e90d0 Mon Sep 17 00:00:00 2001 From: Conor MacBride Date: Sat, 1 Apr 2023 12:09:21 +0100 Subject: [PATCH 5/5] Fix logo path --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index cb7e341d..c9cd50d2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,7 +60,7 @@ "navbar_links": "absolute", "show_prev_next": False, "logo": {"link": "https://matplotlib.org/stable/", - "image_light": "images/logo2.svg", + "image_light": "images/logo_light.svg", "image_dark": "images/logo_dark.svg"}, "collapse_navigation": False, }