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

Improve support for cfgrib #746

Merged
merged 3 commits into from
May 18, 2024
Merged

Conversation

rokm
Copy link
Member

@rokm rokm commented May 18, 2024

Extend the xarray hook to collect additional backend plugins that are registered via the xarray.backends entry-point (e.g., cfgrib).

Add hook for gribapi package from eccodes dist, in order to collect bundled headers and ensure that the eccodes shared library is collected from the build environment.

Manually tested on Windows with Anaconda with program that tries to read a grib file.

The test_eccodes_gribapi might pass on linux, but in reality, the collected shared library cannot yet be discovered (and so the system copy is used). For this to properly work, we will need to add an override for POSIX implementation of ctypes.util.find_library in PyInstaller's bootstrap/loader, which would explicitly search for matching filenames in sys._MEIPASS.

Closes #744.

rokm added 2 commits May 18, 2024 12:56
Collect additional `xarray` backend plugins that are registered via
`xarray.backends` entry-point (for example, `cfgrib`).
Add hook for `gribapi` package from `eccodes` dist, in order to
collect bundled headers and ensure that the eccodes shared library
is collected from the build environment.
@rokm
Copy link
Member Author

rokm commented May 18, 2024

Hmmm, looks like macos-latest now resolves to Sonoma on arm64, and our dependency diff is broken because that ships Apple diff instead of GNU one...

When determining the added and changed entries in the
`requirements-test-libraries.txt`, use a combination of `diff`,
`grep`, and `sed` to extract the relevant lines. We cannot use
`diff --changed-group-format='%>' --unchanged-group-format=''`,
because `--unchanged-group-format` is not available in Apple/FreeBSD
`diff`, which is shipped with macOS Ventura and later.
@rokm rokm merged commit 80908c7 into pyinstaller:master May 18, 2024
14 checks passed
@rokm rokm deleted the hook-eccodes-gribapi branch May 18, 2024 19:29
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

Successfully merging this pull request may close these issues.

A problem converting a grib2 file to a netCDF file using cfgrib and xarray
2 participants