Skip to content

Commit 4a2caf9

Browse files
committed
Match latest zstash python support
1 parent 086eb67 commit 4a2caf9

File tree

5 files changed

+47
-30
lines changed

5 files changed

+47
-30
lines changed

.github/workflows/build_workflow.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,26 @@ jobs:
3737
- name: Checkout Code Repository
3838
uses: actions/checkout@v3
3939

40-
- name: Set up Python
40+
- name: Set up Python 3.13
4141
uses: actions/setup-python@v4
4242
with:
43-
python-version: 3.11
43+
python-version: 3.13
4444

4545
# Run all pre-commit hooks on all the files.
4646
# Getting only staged files can be tricky in case a new PR is opened
4747
# since the action is run on a branch in detached head state.
4848
# This is the equivalent of running "pre-commit run --all-files" locally.
4949
# If you commit with the `--no-verify` flag, this check may fail.
5050
- name: Install and Run Pre-commit
51-
uses: pre-commit/[email protected].0
51+
uses: pre-commit/[email protected].1
5252

5353
build:
5454
needs: check-jobs-to-skip
5555
if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }}
5656
runs-on: ubuntu-latest
57+
strategy:
58+
matrix:
59+
python-version: ["3.11", "3.12", "3.13"]
5760
defaults:
5861
run:
5962
shell: bash -l {0}
@@ -63,11 +66,11 @@ jobs:
6366
- name: Cache Conda
6467
uses: actions/cache@v3
6568
env:
66-
CACHE_NUMBER: 0
69+
CACHE_NUMBER: 1 # Increment this to invalidate cache
6770
with:
6871
path: ~/conda_pkgs_dir
6972
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
70-
hashFiles('conda/dev.yml') }}
73+
hashFiles('conda/dev.yml') }}}-python${{ matrix.python-version }}
7174

7275
- name: Build Conda Environment
7376
uses: conda-incubator/setup-miniconda@v3
@@ -76,8 +79,23 @@ jobs:
7679
miniforge-variant: Miniforge3
7780
miniforge-version: latest
7881
environment-file: conda/dev.yml
79-
channel-priority: strict
82+
channel-priority: flexible # Changed from strict to flexible
8083
auto-update-conda: true
84+
python-version: ${{ matrix.python-version }}
85+
channels: conda-forge
86+
use-only-tar-bz2: true
87+
88+
- name: Verify Environment and Fix Dependencies
89+
run: |
90+
conda info
91+
conda list
92+
# Ensure we have the right Python version
93+
python --version
94+
# Fix pip issues for Python 3.12+
95+
if [[ "${{ matrix.python-version }}" == "3.12" ]] || [[ "${{ matrix.python-version }}" == "3.13" ]]; then
96+
python -m ensurepip --upgrade || true
97+
python -m pip install --upgrade --force-reinstall pip setuptools wheel
98+
fi
8199
82100
- if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }}
83101
name: Show Conda Environment Info
@@ -87,7 +105,7 @@ jobs:
87105
conda list
88106
89107
- name: Install `zppy` Package
90-
run: pip install .
108+
run: python -m pip install .
91109

92110
# Does not run the integration tests, which require server access
93111
- name: Run Unit Tests
@@ -101,7 +119,7 @@ jobs:
101119
defaults:
102120
run:
103121
shell: bash -l {0}
104-
timeout-minutes: 5
122+
timeout-minutes: 10 # Increased timeout for docs
105123
steps:
106124
- uses: actions/checkout@v2
107125
with:
@@ -111,11 +129,11 @@ jobs:
111129
- name: Cache Conda
112130
uses: actions/cache@v3
113131
env:
114-
CACHE_NUMBER: 0
132+
CACHE_NUMBER: 1 # Match the build job cache number
115133
with:
116134
path: ~/conda_pkgs_dir
117135
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
118-
hashFiles('conda/dev.yml') }}
136+
hashFiles('conda/dev.yml') }}-docs
119137

120138
- name: Build Conda Environment
121139
uses: conda-incubator/setup-miniconda@v3
@@ -124,8 +142,9 @@ jobs:
124142
miniforge-variant: Miniforge3
125143
miniforge-version: latest
126144
environment-file: conda/dev.yml
127-
channel-priority: strict
145+
channel-priority: flexible # Changed from strict to flexible
128146
auto-update-conda: true
147+
python-version: "3.11" # Use stable Python version for docs
129148

130149
- if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }}
131150
name: Show Conda Environment Info

conda/dev.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: zppy_dev
22
channels:
33
- conda-forge
4-
- defaults
54
dependencies:
65
# Build
76
# =======================
8-
- python=3.11
9-
- pip=22.2.2
7+
- python >=3.11,<3.14
8+
- pip
109
# Base
1110
# =================
1211
- configobj=5.0.6
@@ -21,22 +20,22 @@ dependencies:
2120
# Documentation
2221
# If versions are updated, also update in `.github/workflows/build_workflow.yml`
2322
# =================
24-
- sphinx=5.2.3
25-
- sphinx_rtd_theme=1.0.0
26-
- sphinx-multiversion=0.2.4
23+
- sphinx >=5.2.0
24+
- sphinx-multiversion >=0.2.4
25+
- sphinx_rtd_theme >=1.0.0
2726
# Need to pin docutils because 0.17 has a bug with unordered lists
2827
# https://github.com/readthedocs/sphinx_rtd_theme/issues/1115
29-
- docutils=0.16
28+
- docutils >=0.16,<0.17
3029
# Quality Assurance Tools
3130
# =======================
3231
# If versions are updated, also update 'rev' in `.pre-commit-config.yaml`
33-
- black=24.10.0 # version from https://anaconda.org/conda-forge/black
34-
- flake8=7.1.1 # version from https://anaconda.org/conda-forge/flake8
32+
- black >=24.0.0
33+
- flake8 >=7.0.0
3534
# This line also implicitly installs isort
36-
- flake8-isort=6.1.1 # version from https://anaconda.org/conda-forge/flake8-isort
37-
- mypy=1.11.2 # version from https://anaconda.org/conda-forge/mypy
38-
- pre-commit=4.0.1 # version from https://anaconda.org/conda-forge/pre-commit
39-
- tbump=6.9.0
35+
- flake8-isort >=6.0.0
36+
- mypy >=1.11.0
37+
- pre-commit >=4.0.0
38+
- tbump >=6.9.0
4039
# Developer Tools
4140
# =======================
4241
- tbump=6.9.0

conda/meta.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% set name = "zppy" %}
22
{% set version = "3.0.0" %}
3-
{% set python_min = "3.11" %}
43

54
package:
65
name: {{ name|lower }}
@@ -17,19 +16,19 @@ build:
1716

1817
requirements:
1918
host:
20-
- python {{ python_min }}
19+
- python >=3.11,<3.14
2120
- pip
2221
- setuptools
2322
run:
24-
- python >={{ python_min }}
23+
- python >=3.11,<3.14
2524
- configobj >=5.0.0,<6.0.0
2625
- jinja2 >=2.0.0
2726
- mache >=1.3.2
2827
- mpas_tools >=0.15.0
2928

3029
test:
3130
requires:
32-
- python {{ python_min }}
31+
- python >=3.11,<3.14
3332
- pip
3433
imports:
3534
- zppy

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ exclude =
4848
venv
4949

5050
[mypy]
51-
python_version = 3.9
51+
python_version = 3.13
5252
check_untyped_defs = True
5353
ignore_missing_imports = True
5454
warn_unused_ignores = True

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def package_files(directory, prefixes, extensions):
2727
author="Ryan Forsyth, Chris Golaz",
2828
2929
description="Post-processing software for E3SM",
30-
python_requires=">=3.9",
30+
python_requires=">=3.11,<3.14",
3131
packages=find_packages(include=["zppy", "zppy.*"]),
3232
package_data={"": data_files},
3333
entry_points={"console_scripts": ["zppy=zppy.__main__:main"]},

0 commit comments

Comments
 (0)