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

WIP: Feature/binary wheel #89

Merged
merged 62 commits into from
Sep 9, 2024
Merged

WIP: Feature/binary wheel #89

merged 62 commits into from
Sep 9, 2024

Conversation

iainrussell
Copy link
Member

@iainrussell iainrussell commented Apr 19, 2024

This Pull Request, when ready, will change the result of 'pip install eccodes' so that it will now include the ecCodes binary library automatically. This will be built for various versions of Python for Linux and MacOS (X64 and Arm64) via GitHub Actions.

By default, this bundled library will be the one used by the Python bindings. In order to use an externally-installed ecCodes binary library, set an environment variable (name of env var subject to discussion).

Current status and how to test

Example release on testpypi: https://test.pypi.org/project/eccodes/1.7.12/#files

The new wheels can be tested like this inside a virtualenv or similar:

pip install eccodes && pip uninstall eccodes # to install the dependencies from pip
pip install -i https://test.pypi.org/simple/ eccodes
# OR, to get a pure Python wheel:
pip install -i https://test.pypi.org/simple/ eccodes --no-binary eccodes

At runtime, set this environment variable to ignore the binary wheel and use external ecCodes binary libs via findlibs:

ECCODES_PYTHON_USE_FINDLIBS=1

Before import eccodes, set this environment variable to get a debug trace of how it is trying to find the binary libraries:

ECCODES_PYTHON_TRACE_LIB_SEARCH=1

@shahramn
Copy link
Collaborator

Re: The name of the environment variable
We already have ECCODES_PYTHON_ENABLE_TYPE_CHECKS
So I prefer to start new env vars with the prefix "ECCODES_PYTHON_"

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 61 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@841f94f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
gribapi/bindings.py 0.00% 43 Missing ⚠️
setup.py 0.00% 16 Missing ⚠️
gribapi/__init__.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #89   +/-   ##
=========================================
  Coverage          ?   32.90%           
=========================================
  Files             ?       16           
  Lines             ?     2547           
  Branches          ?      274           
=========================================
  Hits              ?      838           
  Misses            ?     1697           
  Partials          ?       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iainrussell
Copy link
Member Author

Current names of environment variables:

ECCODES_PYTHON_USE_SEPARATE_BINARIES=1 # ignore the binary wheel and use external ecCodes binary libs
ECCODES_PYTHON_TRACE_LIB_SEARCH=1 # to get debug trace of how it is trying to find the binary libraries

@shahramn shahramn self-assigned this Aug 1, 2024
@iainrussell iainrussell force-pushed the feature/binary-wheel branch 7 times, most recently from d3593e6 to a4f4f39 Compare August 6, 2024 12:31
@jacopo-exact
Copy link

Can I ask the status of this PR? I'm working under contract in an EU project that would greatly benefit from this PR being merged.

@iainrussell
Copy link
Member Author

Hi @jacopo-exact, it just needs a little clean-up (which I intend to do today), then we need to warn users of the upcoming change before we release it.

@iainrussell iainrussell changed the base branch from develop to master September 5, 2024 12:54
@jacopo-exact
Copy link

Not a great contribution but, as a sort of field-testing, we've been developing an application using the binary release on testpipy. It works spot-on, also in conjunction with other libraries such as cfgrib that rely on eccodes, and it is a great relief that we do not need to mess with compiling the library or load it from module or spack.

@iainrussell iainrussell self-assigned this Sep 9, 2024
@iainrussell
Copy link
Member Author

Hi @jacopo-exact, that's great feedback - thanks!

@iainrussell iainrussell merged commit 6a11051 into master Sep 9, 2024
130 checks passed
@iainrussell iainrussell deleted the feature/binary-wheel branch September 9, 2024 08:14
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.

5 participants