Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for python <3.8? #7

Closed
blasee opened this issue Jul 11, 2022 · 2 comments
Closed

Allow for python <3.8? #7

blasee opened this issue Jul 11, 2022 · 2 comments

Comments

@blasee
Copy link

blasee commented Jul 11, 2022

Hey @mx-moth,

Thanks again for developing this package. I'm running into the following error when importing emsarray using python 3.7:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/tmp/ipykernel_22943/494989257.py in <module>
----> 1 import emsarray
      3 """
      4 
----> 5 import importlib.metadata
      6 
      7 from . import tutorial

ModuleNotFoundError: No module named 'importlib.metadata'

It turns out that importlib only has a metadata submodule starting from python 3.8. The jsonschema package uses the following code to circumvent this issue.

try:
    from importlib import metadata
except ImportError: # for Python<3.8
    import importlib_metadata as metadata

which of course requires the installation of the importlib_metadata package.

Is this something that could be implemented in emsarray too?

@sharon-tickell
Copy link

Noting for discussion that Python 3.7 will be EOL in less than 12 months from now (on 2023-06-27)...

I agree we should either support python 3.7 while it is still a supported version OR have a clear statement that we require python>=3.8.

If we're going to support 3.7 properly, though, then that would require downgrading some of the emsarray dependencies, as several of the critical ones have already dropped python 3.7 support:

  • xarray latest is v2022.3.0, and the last version that supported python 3.7 was v0.20.2. emsarray requires v0.21.1, so requires python>=3.8. It looks like the maintainers were following the example of numpy, pandas and pyproj in dropping python 3.7 support
  • pyproj latest is v3.3.1 and the last version that supported python 3.7 was v3.2.1 (emsarray requires 3.3.0, so requires python>=3.8)
  • numpy latest is v1.23.1, and the last version that supported python 3.7 was v1.21.6. (emsarray requirements currently have v1.21.4)
  • pandas latest is v1.4.3, and the last version that supported python 3.7 was v1.3.5 (emsarray requires v1.3.4)
  • scipy latest is v1.8.1, and the last version that supported python 3.7 was v1.7.3 (emsarray requires v1.7.3)

I'm reluctant to lock ourselves into older versions of things like xarray, as that would mean we can't take advantage of new features in that library as they're released (and also, security scanners get whiny about known vulnerabilities).

@blasee what is your use case for needing python 3.7? Any chance of a platform upgrade at your end?

@blasee
Copy link
Author

blasee commented Jul 12, 2022

@sharon-tickell I agree downgrading dependencies is not ideal at all. We certainly have the ability to upgrade python at our end so it seems that's the best option, I didn't quite realise how old 3.7 actually was. I'll close this issue, thanks for your reply!

@blasee blasee closed this as completed Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants