From 4ecdd7979988c3df94e5b33491b427321984bada Mon Sep 17 00:00:00 2001 From: forsyth2 <30700190+forsyth2@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:32:18 -0700 Subject: [PATCH 1/5] Change workflow to mamba (#429) * Change workflow to mamba --- .github/workflows/build_workflow.yml | 7 +++++-- .github/workflows/release_workflow.yml | 3 +-- conda/dev.yml | 3 +-- setup.py | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index 76e6c48a..121b3a61 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -64,6 +64,10 @@ jobs: uses: conda-incubator/setup-miniconda@v2 with: activate-environment: zppy_dev + miniforge-variant: Mambaforge + miniforge-version: latest + use-mamba: true + mamba-version: "*" environment-file: conda/dev.yml channel-priority: strict auto-update-conda: true @@ -117,8 +121,7 @@ jobs: # Using pip for Sphinx dependencies because it takes too long to reproduce a conda environment (~10 secs vs. 3-4 mins) - name: Install Dependencies run: | - python -m pip install --upgrade pip - pip install sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 + mamba install -y sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 - name: Build Sphinx Docs run: | cd docs diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index 1102578e..9c05750f 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -37,8 +37,7 @@ jobs: # Using pip for Sphinx dependencies because it takes too long to reproduce a conda environment (~10 secs vs. 3-4 mins) - name: Install Dependencies run: | - python -m pip install --upgrade pip - pip install sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 + mamba install -y sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 - name: Build Sphinx Docs run: | diff --git a/conda/dev.yml b/conda/dev.yml index 883f10e1..40281e0d 100644 --- a/conda/dev.yml +++ b/conda/dev.yml @@ -27,9 +27,8 @@ dependencies: # ================= - sphinx=5.2.3 - sphinx_rtd_theme=1.0.0 + - sphinx-multiversion==0.2.4 # Need to pin docutils because 0.17 has a bug with unordered lists # https://github.com/readthedocs/sphinx_rtd_theme/issues/1115 - docutils=0.16 - - pip: - - sphinx-multiversion==0.2.4 prefix: /opt/miniconda3/envs/zppy_dev diff --git a/setup.py b/setup.py index 897d1c5d..ab2e8686 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,6 @@ def package_files(directory, prefixes, extensions): author_email="forsyth2@llnl.gov, golaz1@llnl.gov", description="Post-processing software for E3SM", python_requires=">=3.6", - intall_requires=["configobj>=5.0.0,<6.0.0", "jinja2>=2.0.0"], packages=find_packages(include=["zppy", "zppy.*"]), package_data={"": data_files}, entry_points={"console_scripts": ["zppy=zppy.__main__:main"]}, From e7a0e1206375c5d9fc973c0cc929697c86bae663 Mon Sep 17 00:00:00 2001 From: forsyth2 <30700190+forsyth2@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:48:42 -0700 Subject: [PATCH 2/5] Fix GitHub Actions (#434) * Fix GitHub Actions * Revert sphinx-multiversion handling --- .github/workflows/build_workflow.yml | 2 +- conda/dev.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index 121b3a61..ea18766e 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -64,7 +64,7 @@ jobs: uses: conda-incubator/setup-miniconda@v2 with: activate-environment: zppy_dev - miniforge-variant: Mambaforge + miniforge-variant: Mambaforge miniforge-version: latest use-mamba: true mamba-version: "*" diff --git a/conda/dev.yml b/conda/dev.yml index 40281e0d..883f10e1 100644 --- a/conda/dev.yml +++ b/conda/dev.yml @@ -27,8 +27,9 @@ dependencies: # ================= - sphinx=5.2.3 - sphinx_rtd_theme=1.0.0 - - sphinx-multiversion==0.2.4 # Need to pin docutils because 0.17 has a bug with unordered lists # https://github.com/readthedocs/sphinx_rtd_theme/issues/1115 - docutils=0.16 + - pip: + - sphinx-multiversion==0.2.4 prefix: /opt/miniconda3/envs/zppy_dev From c85de9702cf399028a68247952be1008bf904c10 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Fri, 16 Jun 2023 11:07:23 +0200 Subject: [PATCH 3/5] Get sphinx-multiversion from conda-forge --- conda/dev.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conda/dev.yml b/conda/dev.yml index 883f10e1..565fe235 100644 --- a/conda/dev.yml +++ b/conda/dev.yml @@ -26,10 +26,9 @@ dependencies: # If versions are updated, also update in `.github/workflows/build_workflow.yml` # ================= - sphinx=5.2.3 + - sphinx-multiversion=0.2.4 - sphinx_rtd_theme=1.0.0 # Need to pin docutils because 0.17 has a bug with unordered lists # https://github.com/readthedocs/sphinx_rtd_theme/issues/1115 - docutils=0.16 - - pip: - - sphinx-multiversion==0.2.4 prefix: /opt/miniconda3/envs/zppy_dev From c0cab2e201189cabdb87876842a382e6845acab3 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Fri, 16 Jun 2023 11:07:49 +0200 Subject: [PATCH 4/5] Remove redundant dependency installation --- .github/workflows/build_workflow.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index ea18766e..fbb6ad4b 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -118,10 +118,6 @@ jobs: ${{ runner.os }}-pip- ${{ runner.os }}- - # Using pip for Sphinx dependencies because it takes too long to reproduce a conda environment (~10 secs vs. 3-4 mins) - - name: Install Dependencies - run: | - mamba install -y sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 - name: Build Sphinx Docs run: | cd docs From 15ea86a39efe4e17339c7eef68b958574d56bff1 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Fri, 16 Jun 2023 11:13:44 +0200 Subject: [PATCH 5/5] Switch docs workflows to mamba --- .github/workflows/build_workflow.yml | 41 +++++++++++++++++--------- .github/workflows/release_workflow.yml | 40 +++++++++++++++---------- 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index fbb6ad4b..8b0eb936 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -71,8 +71,6 @@ jobs: environment-file: conda/dev.yml channel-priority: strict auto-update-conda: true - # IMPORTANT: This needs to be set for caching to work properly! - use-only-tar-bz2: true - if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }} name: Show Conda Environment Info @@ -102,21 +100,36 @@ jobs: persist-credentials: false fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Cache Conda + uses: actions/cache@v3 + env: + CACHE_NUMBER: 0 with: - python-version: 3.9 + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ + hashFiles('conda/dev.yml') }} - - name: Cache pip - uses: actions/cache@v3 + - name: Build Conda Environment + uses: conda-incubator/setup-miniconda@v2 with: - # This path is specific to Ubuntu - path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-publish-docs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- + activate-environment: zppy_dev + miniforge-variant: Mambaforge + miniforge-version: latest + use-mamba: true + mamba-version: "*" + environment-file: conda/dev.yml + channel-priority: strict + auto-update-conda: true + + - if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }} + name: Show Conda Environment Info + run: | + conda config --set anaconda_upload no + conda info + conda list + + - name: Install `zppy` Package + run: pip install . - name: Build Sphinx Docs run: | diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index 9c05750f..f5108324 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -18,26 +18,36 @@ jobs: persist-credentials: false fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Cache Conda + uses: actions/cache@v3 + env: + CACHE_NUMBER: 0 with: - python-version: 3.9 + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ + hashFiles('conda/dev.yml') }} - - name: Cache pip - uses: actions/cache@v3 + - name: Build Conda Environment + uses: conda-incubator/setup-miniconda@v2 with: - # This path is specific to Ubuntu - path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-publish-docs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- + activate-environment: zppy_dev + miniforge-variant: Mambaforge + miniforge-version: latest + use-mamba: true + mamba-version: "*" + environment-file: conda/dev.yml + channel-priority: strict + auto-update-conda: true - # Using pip for Sphinx dependencies because it takes too long to reproduce a conda environment (~10 secs vs. 3-4 mins) - - name: Install Dependencies + - if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }} + name: Show Conda Environment Info run: | - mamba install -y sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16 + conda config --set anaconda_upload no + conda info + conda list + + - name: Install `zppy` Package + run: pip install . - name: Build Sphinx Docs run: |