intake-xarray icon indicating copy to clipboard operation
intake-xarray copied to clipboard

Python 3.12 support

Open NathanCummings opened this issue 1 year ago • 6 comments

Hi, as far as I can tell, this fails on Python 3.12 as netcdf.py imports distutils which was deprecated in 3.10 and removed in 3.12. Could either:

  • pyproject.toml be updated to reflect the fact that >3.11 is not supported. or (ideally)
  • The incompatible code be removed to enable 3.12+ support.

NathanCummings avatar Oct 23 '24 14:10 NathanCummings

The intake2 branch (#147 ) is aiming to modernise this repo, and most of the functionality is covered in the main intake package. I haven't had much change to work ont he PR, lately. Would you like to test-run it?

martindurant avatar Oct 23 '24 14:10 martindurant

Yep, I'll give it a whirl.

NathanCummings avatar Oct 23 '24 14:10 NathanCummings

FYI, pip install . with a python 3.12 venv (created using uv) required 2 changes in versioneer.py.

image

See the changed lines marked with a blue marker.

This was a bit interesting, as from my reading of the docs, these features were renamed back in python 3.2, so I'm not sure how they found their way here or how it hasn't caused problems before.

NathanCummings avatar Oct 25 '24 13:10 NathanCummings

Probably versioneer itself can be updated by many version points - but switching to setuptools-scm might be more current. I am happy to include your changes, however, if it's the quickest way to make things consistent.

martindurant avatar Oct 28 '24 13:10 martindurant

Agree with both, but the after watching one of your talks about intake2, it feels like this plugin shouldn't even be necessary anymore?

NathanCummings avatar Oct 31 '24 08:10 NathanCummings

Indeed, this is more of an attempt not to loose existing intake-xarray users, and their v1 catalogs, even if they upgrade to intake2.

As can be seen from the code, it's easy in most cases to map v1 sources to v2.

martindurant avatar Oct 31 '24 13:10 martindurant

Has this been fixed by #147?

juntyr avatar Nov 14 '24 09:11 juntyr