Skip to content
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
41 changes: 30 additions & 11 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,26 @@ jobs:
- name: Checkout Code Repository
uses: actions/checkout@v3

- name: Set up Python
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.13

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

build:
needs: check-jobs-to-skip
if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
defaults:
run:
shell: bash -l {0}
Expand All @@ -63,11 +66,11 @@ jobs:
- name: Cache Conda
uses: actions/cache@v3
env:
CACHE_NUMBER: 0
CACHE_NUMBER: 1 # Increment this to invalidate cache
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda/dev.yml') }}
hashFiles('conda/dev.yml') }}-python${{ matrix.python-version }}

- name: Build Conda Environment
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -76,8 +79,23 @@ jobs:
miniforge-variant: Miniforge3
miniforge-version: latest
environment-file: conda/dev.yml
channel-priority: strict
channel-priority: flexible # Changed from strict to flexible
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
use-only-tar-bz2: true

- name: Verify Environment and Fix Dependencies
run: |
conda info
conda list
# Ensure we have the right Python version
python --version
# Fix pip issues for Python 3.12+
if [[ "${{ matrix.python-version }}" == "3.12" ]] || [[ "${{ matrix.python-version }}" == "3.13" ]]; then
python -m ensurepip --upgrade || true
python -m pip install --upgrade --force-reinstall pip setuptools wheel
fi

- if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }}
name: Show Conda Environment Info
Expand All @@ -87,7 +105,7 @@ jobs:
conda list

- name: Install `zppy-interfaces` Package
run: pip install .
run: python -m pip install .

# Does not run the integration tests, which require server access
- name: Run Unit Tests
Expand All @@ -101,7 +119,7 @@ jobs:
defaults:
run:
shell: bash -l {0}
timeout-minutes: 5
timeout-minutes: 10 # Increased timeout for docs
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -111,11 +129,11 @@ jobs:
- name: Cache Conda
uses: actions/cache@v3
env:
CACHE_NUMBER: 0
CACHE_NUMBER: 1 # Match the build job cache number
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda/dev.yml') }}
hashFiles('conda/dev.yml') }}-docs

- name: Build Conda Environment
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -124,8 +142,9 @@ jobs:
miniforge-variant: Miniforge3
miniforge-version: latest
environment-file: conda/dev.yml
channel-priority: strict
channel-priority: flexible # Changed from strict to flexible
auto-update-conda: true
python-version: "3.13" # Use stable Python version for docs

- if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }}
name: Show Conda Environment Info
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ repos:

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

# Can run individually with `pre-commit run isort --all-files`
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.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: 7.1.1
rev: 7.3.0
hooks:
- id: flake8
args: ["--config=.flake8"]
additional_dependencies: [flake8-isort==6.1.1]

# Can run individually with `pre-commit run mypy --all-files`
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.18.2
hooks:
- id: mypy
args: ["--config=pyproject.toml"]
Expand Down
14 changes: 6 additions & 8 deletions conda/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
name: zppy-interfaces-dev
channels:
- conda-forge
- defaults
dependencies:
# Build
# =======================
- python >=3.9
- python >=3.11,<3.14
- pip
- setuptools >= 60
# Base
Expand All @@ -33,12 +32,11 @@ dependencies:
# =======================
# Run `pre-commit autoupdate` to get the latest pinned versions of 'rev' in
# `.pre-commit.config.yaml`, then update the pinned versions here.
- black=24.10.0
- flake8=7.1.1
- flake8-isort=6.1.0
- isort=5.13.2
- mypy=1.11.2
- pre-commit >=3.0.0
- black ==25.1.0
- flake8 ==7.3.0
- isort ==6.0.1
- mypy ==1.18.2
- pre-commit ==4.3.0
- types-PyYAML >=6.0.0
# Developer Tools
# =======================
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ authors = [
description = "A package for providing extra functionality on top of external packages"
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11,<3.14"
classifiers = [
# these are only for searching/browsing projects on PyPI
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down Expand Up @@ -98,7 +96,7 @@ exclude = '''
'''

[tool.mypy]
python_version = 3.9
python_version = 3.13
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
Expand Down
Loading