From 79ce0fb4367fc20a5a35f8dc0bc51fd51f564618 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Mon, 24 Apr 2023 12:45:16 -0400 Subject: [PATCH 1/8] Use conda env in GHA same as on read-the-docs --- .github/workflows/continuous-integration.yml | 21 ++++++++++---------- docs/conf.py | 2 +- docs/environment.yml | 6 +++++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index eddb6f80..f76bd158 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -78,21 +78,22 @@ jobs: run: ./scripts/test docs: + if: matrix.python-version != "3.11" name: docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Setup Conda Environment + uses: conda-incubator/setup-miniconda@v2.2.0 with: - python-version: 3.9 - cache: "pip" - cache-dependency-path: "requirements-docs.txt" - - name: Install pandoc - run: sudo apt-get update && sudo apt-get -y install pandoc - - name: Install docs requirements - run: pip install -r requirements-docs.txt - - name: Install pystac_client - run: pip install . + miniforge-variant: Mambaforge + miniforge-version: latest + use-mamba: true + python-version: ${{ matrix.python-version }} + channel-priority: strict + environment-file: ./docs/environment.yml + activate-environment: pystac-client-docs + auto-activate-base: false - name: Build docs run: ./scripts/build-docs diff --git a/docs/conf.py b/docs/conf.py index be94acf8..2fa352b4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -63,7 +63,7 @@ ) } -nbsphinx_allow_errors = True +nbsphinx_allow_errors = False # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/docs/environment.yml b/docs/environment.yml index 20d8d096..d3fc870d 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -3,7 +3,11 @@ channels: - conda-forge - defaults dependencies: - - python=3.8 + - cartopy + - geoviews + - pandoc + - python=3.9 + - pip - pip: - -r ../requirements-docs.txt - -e ../ From ca6c266d57ba04e133ec70b1c90a8f4cc6c8b440 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Tue, 25 Apr 2023 08:22:26 -0400 Subject: [PATCH 2/8] Docs build is outside of matrix --- .github/workflows/continuous-integration.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f76bd158..e2d380fb 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -78,7 +78,6 @@ jobs: run: ./scripts/test docs: - if: matrix.python-version != "3.11" name: docs runs-on: ubuntu-latest steps: @@ -89,7 +88,6 @@ jobs: miniforge-variant: Mambaforge miniforge-version: latest use-mamba: true - python-version: ${{ matrix.python-version }} channel-priority: strict environment-file: ./docs/environment.yml activate-environment: pystac-client-docs From edf8dc0bb16b482c499bc606ef4f246093f4c682 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Tue, 25 Apr 2023 09:44:49 -0400 Subject: [PATCH 3/8] Make docs build more similar to readthedocs --- .github/workflows/continuous-integration.yml | 1 + scripts/build-docs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e2d380fb..436c247c 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -87,6 +87,7 @@ jobs: with: miniforge-variant: Mambaforge miniforge-version: latest + python-version: 3.9 use-mamba: true channel-priority: strict environment-file: ./docs/environment.yml diff --git a/scripts/build-docs b/scripts/build-docs index 1a03bb25..9998d710 100755 --- a/scripts/build-docs +++ b/scripts/build-docs @@ -17,6 +17,6 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then if [ "${1:-}" = "--help" ]; then usage else - sphinx-build -M html docs docs/build + python -m sphinx -T -E -b html docs docs/build fi fi From 36d5d11aebc4d2fe30d2e88164dce34654a82950 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Tue, 25 Apr 2023 09:48:56 -0400 Subject: [PATCH 4/8] Try inlining the command --- .github/workflows/continuous-integration.yml | 2 +- scripts/build-docs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 436c247c..dae8c703 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -94,7 +94,7 @@ jobs: activate-environment: pystac-client-docs auto-activate-base: false - name: Build docs - run: ./scripts/build-docs + run: sphinx-build -M html docs docs/build pre-release: name: pre-release diff --git a/scripts/build-docs b/scripts/build-docs index 9998d710..1a03bb25 100755 --- a/scripts/build-docs +++ b/scripts/build-docs @@ -17,6 +17,6 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then if [ "${1:-}" = "--help" ]; then usage else - python -m sphinx -T -E -b html docs docs/build + sphinx-build -M html docs docs/build fi fi From 64a8023d10d2692bc073af3ccdf5576535f705e5 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Tue, 25 Apr 2023 10:13:48 -0400 Subject: [PATCH 5/8] Add source --- .github/workflows/continuous-integration.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index dae8c703..339a665a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -94,7 +94,9 @@ jobs: activate-environment: pystac-client-docs auto-activate-base: false - name: Build docs - run: sphinx-build -M html docs docs/build + run: | + source mamba list + source ./scripts/docs pre-release: name: pre-release From b12c6aa3a80f7920ecc23be00e4f072d24cbdc9b Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Tue, 25 Apr 2023 10:19:47 -0400 Subject: [PATCH 6/8] Split up list and run --- .github/workflows/continuous-integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 339a665a..96a39c07 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -93,10 +93,10 @@ jobs: environment-file: ./docs/environment.yml activate-environment: pystac-client-docs auto-activate-base: false + - name: List environment + run: source mamba list - name: Build docs - run: | - source mamba list - source ./scripts/docs + run: source ./scripts/docs pre-release: name: pre-release From 7c67c143a1c6bb6cbe9d4766b9a8a2d2fcb2bd17 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Tue, 25 Apr 2023 10:26:42 -0400 Subject: [PATCH 7/8] Default shell --- .github/workflows/continuous-integration.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 96a39c07..2fc7749a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -80,6 +80,10 @@ jobs: docs: name: docs runs-on: ubuntu-latest + # Required shell entrypoint to have properly activated conda environment + defaults: + run: + shell: bash -l {0} steps: - uses: actions/checkout@v3 - name: Setup Conda Environment @@ -94,9 +98,9 @@ jobs: activate-environment: pystac-client-docs auto-activate-base: false - name: List environment - run: source mamba list + run: mamba list - name: Build docs - run: source ./scripts/docs + run: ./scripts/docs pre-release: name: pre-release From 78bbf3f40ccd56030bece000cc0e9d0206900235 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Tue, 25 Apr 2023 10:30:49 -0400 Subject: [PATCH 8/8] Fix name of script --- .github/workflows/continuous-integration.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2fc7749a..ef4a0268 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -97,10 +97,8 @@ jobs: environment-file: ./docs/environment.yml activate-environment: pystac-client-docs auto-activate-base: false - - name: List environment - run: mamba list - name: Build docs - run: ./scripts/docs + run: ./scripts/build-docs pre-release: name: pre-release