Repository: jbusecke/xMIP (language: python)

Issue:
Upstream dev CI failing during mamba stage
The [upstream build](https://github.com/jbusecke/cmip6_preprocessing/runs/6460713102?check_suite_focus=true) is failing, and I am not quite sure I understand why. 

It seems that this happens during the environment setup step, not the testing itself, maybe this is some issue with the github actions themselves or mamba?
For now I will wait and see if this issue resolves itself, but I wanted to tag it here. Maybe someone has seen this happen before and has some tips.


Discussion / hints:
somewhere in your yaml file you need `python: '3.10'` as a string `python: 3.10` gets parsed as `'3.1'`
Ohhhhhh

Fix patch:
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 80b60781..ba5e40fb 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -37,7 +37,7 @@ jobs:
       fail-fast: false
       matrix:
         os: ["ubuntu-latest"]
-        python-version: ["3.7", "3.8", "3.9"]
+        python-version: ["3.7", "3.8", "3.9", "3.10"]
     steps:
       - name: Cancel previous runs
         uses: styfle/cancel-workflow-action@0.9.1
@@ -109,7 +109,7 @@ jobs:
         channel-priority: strict
         activate-environment: test_env_cmip6_preprocessing # Defined in ci/environment-upstream-dev.yml
         auto-update-conda: false
-        python-version: 3.10
+        python-version: "3.10"
         environment-file: ci/environment-upstream-dev.yml
         use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
     - name: Set up conda environment
@@ -155,7 +155,7 @@ jobs:
         channel-priority: strict
         activate-environment: test_env_cmip6_preprocessing # Defined in ci/environment-upstream-dev.yml
         auto-update-conda: false
-        python-version: 3.9
+        python-version: "3.10"
         environment-file: ci/environment-cloud-test.yml
         use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
     - name: Set up conda environment
diff --git a/ci/environment-upstream-dev.yml b/ci/environment-upstream-dev.yml
index 9462047f..07b27915 100644
--- a/ci/environment-upstream-dev.yml
+++ b/ci/environment-upstream-dev.yml
@@ -4,16 +4,21 @@ channels:
 dependencies:
   - cftime
   - dask
+  - xgcm <0.7.0 # temporary pin since we need 'extrapolate' option for padding
   - pip
   - cartopy #installing this without conda is a nightmare, so ill leave it here
   - xesmf # same here
+  - rasterio # Trying to get around an apparent bug with py 3.10 + pip + rasterio (https://github.com/jbusecke/cmip6_preprocessing/pull/231#issuecomment-1132190649)
+  # These are only a patch until xesmf > 0.6.2 is released. See https://github.com/pangeo-data/xESMF/issues/170
+  - numba
+  - sparse>=0.8.0
   - pip:
     - codecov
     - pytest-cov
     - pytest-xdist
     - git+https://github.com/regionmask/regionmask.git
     - git+https://github.com/pydata/xarray.git
-    - git+https://github.com/xgcm/xgcm.git
+    #- git+https://github.com/xgcm/xgcm.git
     - git+https://github.com/jbusecke/xarrayutils.git
     - git+https://github.com/xarray-contrib/cf-xarray.git
     - git+https://github.com/hgrecco/pint.git
diff --git a/ci/environment.yml b/ci/environment.yml
index b1a2bb1a..c46dc420 100644
--- a/ci/environment.yml
+++ b/ci/environment.yml
@@ -18,3 +18,6 @@ dependencies:
   - pytest-cov
   - pytest-xdist
   - codecov
+  # These are only a patch until xesmf > 0.6.2 is released. See https://github.com/pangeo-data/xESMF/issues/170
+  - numba
+  - sparse>=0.8.0


Test patch:
diff --git a/ci/environment-cloud-test.yml b/ci/environment-cloud-test.yml
index 021823a7..3a575092 100644
--- a/ci/environment-cloud-test.yml
+++ b/ci/environment-cloud-test.yml
@@ -3,7 +3,7 @@ channels:
   - conda-forge
 dependencies:
   - xarray>=0.17.0
-  - xgcm
+  - xgcm < 0.7.0 # temporary pin since we need 'extrapolate' option for padding
   # Dependencies for the pangeo cloud data
   - intake-esm
   - gcsfs
@@ -16,3 +16,6 @@ dependencies:
   - pytest-xdist
   - pytest-rerunfailures
   - codecov
+  # These are only a patch until xesmf > 0.6.2 is released. See https://github.com/pangeo-data/xESMF/issues/170
+  - numba
+  - sparse>=0.8.0