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

Need to pin importlib-metadata for incompatibilities with esmpy/esmf #132

Closed
peanutfun opened this issue Jun 27, 2024 · 10 comments
Closed
Labels
dependencies Problems arising from imported libraries or their versions

Comments

@peanutfun
Copy link
Member

We need to pin esmpy (a dependency of xesmf) to avoid version 8.4. This version is incompatible with the latest importlib-metadata version and causes the current builds to fail on Python 3.10+.

The pin should be

# env_climada.yml
dependencies:
  - esmpy<8.4.0,>=8.6

See pangeo-data/xESMF#374

@peanutfun peanutfun added the dependencies Problems arising from imported libraries or their versions label Jun 27, 2024
@peanutfun
Copy link
Member Author

Pinning esmpy<8.4.0,>=8.6 is not possible, because version specifiers always imply an AND relationship. We therefore have to do esmpy!=8.4.*

@emanuel-schmid
Copy link
Contributor

Nice! This leaves but one problem: looks like esmpy 8.4 is the only available version for Windows 😢

@peanutfun
Copy link
Member Author

According to conda-forge, v8.6 is flagged noarch, so it should work for Windows 🤔

@peanutfun
Copy link
Member Author

Fixed by #133

@emanuel-schmid
Copy link
Contributor

Right - it should. But, alas:

mamba install esmpy=8.6 -c conda-forge
Could not solve for environment specs
The following packages are incompatible
└─ esmpy 8.6**  is uninstallable because there are no viable options
   ├─ esmpy 8.6.0 would require
   │  └─ esmf 8.6.0.* , which does not exist (perhaps a missing channel);
   └─ esmpy 8.6.1 would require
      └─ esmf 8.6.1.* , which does not exist (perhaps a missing channel).

Summary:

  • 8.4 is broken and inhibits import of climada_petals.hazard.rf_glofas for python >= 3.10,
  • 8.4 is corrupted for python >= 3.9 on Windows, test_rf_glofas fails on Windows #127
  • 8.4 is also the only available version from conda-forge for Windows.

bottom line: rf_glofas doesn't work on Windows at the moment. How should we deal with this?

@peanutfun
Copy link
Member Author

Ah, the issue is esmf, not esmpy 🤦 , and the problem is known: conda-forge/esmf-feedstock#115

Then I suggest we simply pin importlib-metadata<8.0, because this library actually causes the issue.

I found no time to investigate #127 yet, unfortunately.

@peanutfun peanutfun changed the title Need to pin esmpy for incompatibilities with importlib-metadata Need to pin importlib-metadata for incompatibilities with esmpy/esmf Jul 9, 2024
@emanuel-schmid
Copy link
Contributor

Good idea, but that doesn't solve the problem,
Perhaps because importlib.metadata is taken from the standard library and not from the imported package. 🤷

@peanutfun
Copy link
Member Author

Did you try that? importlib_metadata is a third-party package with more recent features than importlib.metadata. According to the original report and our logs, the error originates in importlib_metadata (NO dot!) v8.0 which is way ahead of importlib.metadata, see https://github.com/python/importlib_metadata?tab=readme-ov-file#compatibility.

@emanuel-schmid
Copy link
Contributor

emanuel-schmid commented Jul 18, 2024

Yes I have tried: 7b7dfed and then jenkins couldn't build the environment anymore. But that was perhaps just coincidence or a typo: Now it works: 8c515a6. 🎉

@peanutfun
Copy link
Member Author

I'm glad! Thanks for looking into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Problems arising from imported libraries or their versions
Projects
None yet
Development

No branches or pull requests

2 participants