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

Update package versions #321

Merged
merged 3 commits into from
Oct 12, 2022
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
13 changes: 9 additions & 4 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- name: Checkout Code Repository
uses: actions/checkout@v2

- name: Set up Python 3.7
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.9
Comment on lines +33 to +36
Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated to Python 3.9 (it will pick up the latest patch version, which is 3.9.13).


# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.9
Comment on lines 101 to +104
Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated to Python 3.9 (it will pick up the latest patch version, which is 3.9.13).


- name: Cache pip
uses: actions/cache@v2
Expand All @@ -113,28 +113,33 @@ jobs:
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
run: |
python -m pip install --upgrade pip
pip install sphinx==4.0.2 sphinx_rtd_theme==0.5.2 sphinx-multiversion==0.2.4 docutils==0.16
pip install sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16
Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated these doc dependencies in the GH Actions to align with dev.yml

- name: Build Sphinx Docs
run: |
cd docs
sphinx-multiversion source _build/html

Copy link
Collaborator

Choose a reason for hiding this comment

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

Added line breaks between steps to make them easier to read.

- name: Copy Docs and Commit
run: |
# gh-pages branch must already exist
git clone https://github.com/E3SM-Project/zppy.git --branch gh-pages --single-branch gh-pages

# Only replace main docs with latest changes. Docs for tags should be untouched.
cd gh-pages
rm -r _build/html/main
cp -r ../docs/_build/html/main _build/html/main
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

# The below command will fail if no changes were present, so we ignore it
git add .
git commit -m "Update documentation" -a || true

- name: Push Changes
uses: ad-m/github-push-action@master
with:
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
activate-environment: "zppy_publish"
channel-priority: strict
python-version: 3.7
python-version: 3.9
Comment on lines 27 to +30
Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated to Python 3.9 (it will pick up the latest patch version, which is 3.9.13).

auto-update-conda: true
# IMPORTANT: This needs to be set for caching to work properly!
use-only-tar-bz2: true
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.9
Comment on lines 70 to +73
Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated to Python 3.9 (it will pick up the latest patch version, which is 3.9.13).


- name: Cache pip
uses: actions/cache@v2
Expand All @@ -82,29 +82,36 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

Copy link
Collaborator

Choose a reason for hiding this comment

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

Added line breaks between steps to make them easier to read.

# 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==4.0.2 sphinx_rtd_theme==0.5.2 sphinx-multiversion==0.2.4 docutils==0.16
pip install sphinx==5.2.3 sphinx_rtd_theme==1.0.0 sphinx-multiversion==0.2.4 docutils==0.16
Comment on lines 86 to +90
Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated these doc dependencies in the GH Actions to align with dev.yml


- name: Build Sphinx Docs
run: |
cd docs
sphinx-multiversion source _build/html

- name: Copy Docs and Commit
run: |
# gh-pages branch must already exist
git clone https://github.com/E3SM-Project/zppy.git --branch gh-pages --single-branch gh-pages
cd gh-pages

# Replace main docs to populate dropdown with latest tags
rm -r _build/html/main

# Only copy docs for main and current tag
cp -r -n ../docs/_build/html _build/
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

# The below command will fail if no changes were present, so we ignore it
git add .
git commit -m "Update documentation" -a || true

- name: Push Changes
uses: ad-m/github-push-action@master
with:
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -13,29 +13,29 @@ repos:

# Can run individually with `pre-commit run black --all-files`
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.8.0
hooks:
- id: black

# Can run individually with `pre-commit run isort --all-files`
- repo: https://github.com/timothycrosley/isort
rev: 5.9.1
rev: 5.10.1
hooks:
- id: isort

# Can run individually with `pre-commit run flake8 --all-files`
# Need to use flake8 GitHub mirror due to CentOS git issue with GitLab
# https://github.com/pre-commit/pre-commit/issues/1206
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
rev: 5.0.4
hooks:
- id: flake8
args: ["--config=setup.cfg"]
additional_dependencies: [flake8-isort]

# Can run individually with `pre-commit run mypy --all-files`
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
rev: v0.982
hooks:
- id: mypy
args: ["--config=setup.cfg"]
28 changes: 14 additions & 14 deletions conda/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ channels:
dependencies:
# Base
# =================
- python=3.9.13
- pip=22.2.2
Comment on lines +8 to +9
Copy link
Collaborator

@tomvothecoder tomvothecoder Oct 12, 2022

Choose a reason for hiding this comment

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

I moved python and pip to the top because that's where they are usually listed since they are "system" level dependencies required to install the other packages.

- configobj=5.0.6
- jinja2=3.1.2
- mache >=1.3.2
- pillow=8.1.2
- pip=21.0.1
- python=3.7.10
- mache>=1.5.0
- pillow=9.2.0
# Developer Tools
# =================
# If versions are updated, also update 'rev' in `.pre-commit.config.yaml`
- black=22.3.0 # version from https://anaconda.org/conda-forge/black
- flake8=3.9.2 # version from https://anaconda.org/conda-forge/flake8
# If versions are updated, also update 'rev' in `.pre-commit-config.yaml`
- black=22.8.0 # version from https://anaconda.org/conda-forge/black
- flake8=5.0.4 # version from https://anaconda.org/conda-forge/flake8
# This line also implicitly installs isort
- flake8-isort=4.0.0 # version from https://anaconda.org/conda-forge/flake8-isort
- mypy=0.910 # version from https://anaconda.org/conda-forge/mypy
- pre-commit=2.13.0 # version from https://anaconda.org/conda-forge/pre-commit
- flake8-isort=4.2.0 # version from https://anaconda.org/conda-forge/flake8-isort
- mypy=0.982 # version from https://anaconda.org/conda-forge/mypy
- pre-commit=2.20.0 # version from https://anaconda.org/conda-forge/pre-commit
- tbump=6.9.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

tbump is now available on conda-forge so it doesn't need to be installed through - pip :

# Documentation
# If versions are updated, also update in `.github/workflows/workflow.yml`
# If versions are updated, also update in `.github/workflows/build_workflow.yml`
# =================
- sphinx=3.5.1
- sphinx_rtd_theme=0.5.1
- sphinx=5.2.3
- 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
- tbump==6.3.2
prefix: /opt/miniconda3/envs/zppy_dev