From d71bb128e7b3c268162f6f14b772294123592f44 Mon Sep 17 00:00:00 2001 From: zmoon Date: Thu, 13 Jul 2023 17:07:46 -0600 Subject: [PATCH 1/2] Check xesmf version before using micromamba this step was taking 30+ seconds last few times --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7fb2fb1..6b6006eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,16 @@ jobs: - name: Ensure xesmf>=0.7 if not on Python 3.6 if: matrix.python-version != '3.6' - run: micromamba install 'xesmf>=0.7' + run: | + update_needed=$(python -c " + from packaging.version import Version + import xesmf as xe + v = Version(getattr(xe, '__version__', '0.0.0')) + print('n' if v >= Version('0.7') else 'y') + ") + if [[ $update_needed == 'y' ]]; then + micromamba install 'xesmf>=0.7' + fi - name: Install package run: python -m pip install -e . --no-deps From 61b88d8f6848d3a94848650d2e9101a30623ed91 Mon Sep 17 00:00:00 2001 From: zmoon Date: Thu, 13 Jul 2023 17:13:45 -0600 Subject: [PATCH 2/2] Print version to sderr --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b6006eb..e8e2d346 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,9 +40,11 @@ jobs: if: matrix.python-version != '3.6' run: | update_needed=$(python -c " + import sys from packaging.version import Version import xesmf as xe v = Version(getattr(xe, '__version__', '0.0.0')) + print(v, file=sys.stderr) print('n' if v >= Version('0.7') else 'y') ") if [[ $update_needed == 'y' ]]; then