Skip to content

Conversation

@forsyth2
Copy link
Collaborator

@forsyth2 forsyth2 commented Sep 16, 2025

Summary

Objectives:

  • Update Python support to 3.11+

Select one: This pull request is...

  • a bug fix: increment the patch version
  • a small improvement: increment the minor version
  • a new feature: increment the minor version
  • an incompatible (non-backwards compatible) API change: increment the major version

Small Change

  • To merge, I will use "Squash and merge". That is, this change should be a single commit.
  • Logic: I have visually inspected the entire pull request myself.
  • Pre-commit checks: All the pre-commits checks have passed.

@forsyth2 forsyth2 self-assigned this Sep 16, 2025
@forsyth2 forsyth2 added the DevOps CI/CD, configuration, etc. label Sep 16, 2025
@forsyth2
Copy link
Collaborator Author

Testing
lcrc_conda
cd ~/ez/zppy
git fetch upstream main
git status
# Check for uncommitted changes
git checkout -b update-python upstream/main
git grep -n python
# Make changes to support python3.11+
rm -rf build
conda clean --all --y
conda env create -f conda/dev.yml -n zppy-py-3-11-20250916
conda activate zppy-py-3-11-20250916
pre-commit run --all-files
python -m pip install .
pytest tests/test_*.py
# 25 passed
git add -A
git commit -m "Update Python support"

path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda/dev.yml') }}
hashFiles('conda/dev.yml') }}}-python${{ matrix.python-version }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove 3rd }

@xylar
Copy link
Contributor

xylar commented Sep 25, 2025

@forsyth2 , please add me as a reviewer when this is ready for review.

channel-priority: strict
channel-priority: flexible # Changed from strict to flexible
auto-update-conda: true
python-version: "3.11" # Use stable Python version for docs
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change to 3.13

- docutils>=0.16 # Removed <0.17 constraint
# Quality Assurance Tools
# =======================
# If versions are updated, also update 'rev' in `.pre-commit-config.yaml`
Copy link
Collaborator Author

@forsyth2 forsyth2 Sep 25, 2025

Choose a reason for hiding this comment

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

Do this: "If versions are updated, also update 'rev' in .pre-commit-config.yaml"

Copy link
Collaborator Author

@forsyth2 forsyth2 Sep 25, 2025

Choose a reason for hiding this comment

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

The autoupdate didn't seem to work for zppy-interfaces: E3SM-Project/zppy-interfaces#33 (comment), so I didn't do it here either.

@forsyth2 forsyth2 marked this pull request as ready for review September 25, 2025 17:24
@forsyth2
Copy link
Collaborator Author

@tomvothecoder Thanks for reviewing E3SM-Project/zstash#384. Can you also take a look at this PR for zppy as well as zppy-interface's E3SM-Project/zppy-interfaces#33? For both, I'm a little confused if the pre-commit packages have the right versions. There's a lot to coordinate!!

@xylar also tagging you for review, since you requested. Thanks!

conda/dev.yml Outdated
Comment on lines 33 to 38
- black >=24.0.0
- flake8 >=7.0.0
# This line also implicitly installs isort
- flake8-isort=6.1.1 # version from https://anaconda.org/conda-forge/flake8-isort
- mypy=1.11.2 # version from https://anaconda.org/conda-forge/mypy
- pre-commit=4.0.1 # version from https://anaconda.org/conda-forge/pre-commit
- tbump=6.9.0
- flake8-isort >=6.0.0
- mypy >=1.11.0
- pre-commit >=4.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Same suggestion here. Use the latest versions and pin them with ==, just like in zppy-interfaces.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest that you update .pre-commit-config.yaml as well in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in c108327. Looks like it's passing 3.11, 3.12, 3.13.

Copy link
Contributor

Choose a reason for hiding this comment

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

A note for the near future: consider moving to a pyproject.toml.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can take this on once this PR goes in. It's pretty trivial with copilot.

@xylar
Copy link
Contributor

xylar commented Oct 1, 2025

One more place to update:
https://github.com/E3SM-Project/zppy/blob/main/pyproject.toml#L7

I don't know if this should be python 3.11 (the lowest supported version) or python 3.13 (the highest). What is being done elsewhere, @tomvothecoder?

conda/dev.yml Outdated
- tbump >=6.9.0
# Developer Tools
# =======================
- tbump=6.9.0
Copy link
Contributor

Choose a reason for hiding this comment

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

This is listed twice:

Suggested change
- tbump=6.9.0

@tomvothecoder
Copy link
Collaborator

One more place to update: main/pyproject.toml#L7

I don't know if this should be python 3.11 (the lowest supported version) or python 3.13 (the highest). What is being done elsewhere, @tomvothecoder?

There isn't a set guideline on what this should be (min, max, or range). I decided to go with the min supported Python when I was using black.

@forsyth2
Copy link
Collaborator Author

forsyth2 commented Oct 1, 2025

I decided to go with the min supported Python

So does that mean change target-version = ['py36'] to target-version = ['py311']?

@forsyth2
Copy link
Collaborator Author

forsyth2 commented Oct 1, 2025

This is listed twice:
I decided to go with the min supported Python

@xylar @tomvothecoder I addressed these comments in 4c5f285. The GitHub Actions are passing for 3.11, 3.12, 3.13. Is this good to merge?

Copy link
Contributor

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Looks right to me!

@xylar xylar mentioned this pull request Oct 2, 2025
7 tasks
Copy link
Collaborator

@tomvothecoder tomvothecoder left a comment

Choose a reason for hiding this comment

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

LGTM

@forsyth2 forsyth2 merged commit 9b8c9ab into main Oct 2, 2025
6 checks passed
@forsyth2 forsyth2 deleted the update-python branch October 2, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DevOps CI/CD, configuration, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants