xarray-contrib / xwrf

A lightweight interface for working with the Weather Research and Forecasting (WRF) model output in Xarray.
https://xwrf.readthedocs.io/
Apache License 2.0
56 stars 16 forks source link

[Bug]: CI breaks due xgcm dropping python 3.8 support #76

Closed lpilz closed 2 years ago

lpilz commented 2 years ago

What happened?

Currently, the CI breaks on main, as for some reason the typing library being shipped with python 3.8 is so old that it doesn't support the get_type_hints(include_extras=True) kwarg. It seems to me like this might be a problem with xgcm's dependencies

Minimal Complete Verifiable Example

No response

Relevant log output

No response

Environment

System Information
------------------
xWRF commit : 62a96134a6e9abb06f629aee6013a40bbffb9c2b
python      : 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:10) 
[GCC 10.3.0]
python-bits : 64
OS          : Linux
OS-release  : 5.17.3-arch1-1
machine     : x86_64
processor   : 
byteorder   : little
LC_ALL      : en_US.UTF-8
LANG        : en_US.UTF-8
LOCALE      : ('en_US', 'UTF-8')

Installed Python Packages
-------------------------
cf_xarray   : 0.7.2
dask        : 2022.04.1
donfig      : 0.7.0
matplotlib  : 3.5.1
metpy       : 1.3.0
netCDF4     : None
numpy       : 1.22.3
pandas      : 1.4.2
pint        : 0.19.1
pooch       : v1.6.0
pyproj      : 3.3.0
xarray      : 2022.3.0
xgcm        : None
xwrf        : unknown

Anything else we need to know?

No response

dcherian commented 2 years ago

The latest xgcm dropped support for 3.8

lpilz commented 2 years ago

Ah, that's a good explanation. Should we then restrict the xgcm version to the one before the new or can we do this smarter somehow? Shouldn't conda take care of this if we don't explicitly depend on the newest xgcm?

kmpaul commented 2 years ago

Well, xwrf doesn't depend on xgcm, just the tests, right? If that's true, then I would skip the xgcm test if the python version is 3.8. Use something like @pytest.mark.skipif(pyversion == 3.8, reason="xgcm doesn't work with Python 3.8"). But checking the python version needs to be done right.

kmpaul commented 2 years ago

Actually, it looks like xgcm now only works with python version >=3.9, which means you can mark the xgcm test(s) like so:

from sys import version_info
@pytest.mark.skipif(version_info < (3, 9), reason="xgcm only works with Python 3.9+")
def test_xgcm():
     ...
dcherian commented 2 years ago

https://github.com/xgcm/xgcm/issues/484#issuecomment-1105344303

It's just a bad conda yaml

kmpaul commented 2 years ago

Fixed in #70