Skip to content
22 changes: 16 additions & 6 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,24 @@ jobs:
- name: Checkout Code Repository
uses: actions/checkout@v3

- name: Set up Python 3.9
- name: Set up Python 3.11
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- name: Set up Python 3.11
- name: Set up Python 3.13

uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
python-version: 3.11
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:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
python-version: [3.11, 3.12]
python-version: [3.11, 3.12, 3.13]

defaults:
run:
shell: bash -l {0}
Expand All @@ -48,7 +51,7 @@ jobs:
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 @@ -59,11 +62,18 @@ jobs:
environment-file: conda/dev.yml
channel-priority: strict
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
use-only-tar-bz2: true

- name: Fix pip and setuptools for Python 3.12+
run: |
python -m ensurepip --upgrade
python -m pip install --upgrade --force-reinstall pip setuptools wheel

- name: Install `zstash` Package
run: |
python -m pip install --upgrade pip
pip install .
python -m pip install .

- name: Run Tests
run: |
Expand Down
5 changes: 3 additions & 2 deletions conda/dev.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: zstash_dev
channels:
- conda-forge
- defaults
- nodefaults # This replaces 'defaults' to avoid Anaconda commercial repos
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In one of the fix attempts, GitHub Actions failed because of some licensing issue, so Claude suggested this fix. Although, looking at the final PR diff, it seems strange defaults worked fine before...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just specify conda-forge and remove defaults. I don't know whether nodefaults is needed or not.

dependencies:
# Base
# =================
- pip=22.2.2
- python=3.9.13
- python >=3.11,<3.14
- sqlite
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tomvothecoder How do we determine the constraints (=, >=, etc.)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is based on the conda-forge recipe and compatibility with other packages. If things break with new package versions, that suggests updating the constraints accordingly.

- six=1.16.0
- globus-sdk=3.15.0
# Developer Tools
Expand Down
5 changes: 3 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ build:

requirements:
host:
- python >=3.9
- python >=3.11,<3.14
- pip

run:
- python >=3.9
- python >=3.11,<3.14
- fair-research-login >=0.2.6,<0.3.0
- globus-sdk >=3.0.0,<4.0.0
- six
- sqlite

test:
imports:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exclude =
venv

[mypy]
python_version = 3.9
python_version = 3.13
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do we choose the specific version for this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Latest stable version of Python.

check_untyped_defs = True
ignore_missing_imports = True
warn_unused_ignores = True
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
author_email="[email protected], [email protected], [email protected]",
description="Long term HPSS archiving software for E3SM",
packages=find_packages(include=["zstash", "zstash.*"]),
python_requires=">=3.9",
python_requires=">=3.11,<3.14",
entry_points={"console_scripts": ["zstash=zstash.main:main"]},
)
2 changes: 1 addition & 1 deletion zstash/globus.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def globus_block_wait(
try:
# Wait for the task to complete
logger.info(
f"{ts_utc()}: on task_wait try {retry_count+1} out of {max_retries}"
f"{ts_utc()}: on task_wait try {retry_count + 1} out of {max_retries}"
)
transfer_client.task_wait(
task_id, timeout=wait_timeout, polling_interval=10
Expand Down
Loading