Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change workflows to mamba, take 2 #438

Merged
merged 5 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ 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
# IMPORTANT: This needs to be set for caching to work properly!
use-only-tar-bz2: true
Comment on lines -70 to -71
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary any longer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think it causes problems because most newer releases are as .conda files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may explain why sphinx-multiversion couldn't be installed.


- if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }}
name: Show Conda Environment Info
Expand Down Expand Up @@ -98,27 +100,37 @@ 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 }}-

# Using pip for Sphinx dependencies because it takes too long to reproduce a conda environment (~10 secs vs. 3-4 mins)
- name: Install Dependencies
Comment on lines -117 to -118
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be much better with mamba instead of conda.

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: |
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
conda config --set anaconda_upload no
conda info
conda list

- name: Install `zppy` Package
run: pip install .

- name: Build Sphinx Docs
run: |
cd docs
Expand Down
41 changes: 25 additions & 16 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +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: |
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
conda config --set anaconda_upload no
conda info
conda list

- name: Install `zppy` Package
run: pip install .

- name: Build Sphinx Docs
run: |
Expand Down
3 changes: 1 addition & 2 deletions conda/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this matters but using single rather than double = here to match other dependencies.

- 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
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def package_files(directory, prefixes, extensions):
author_email="[email protected], [email protected]",
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"]},
Expand Down