Skip to content

Commit

Permalink
ECC-1793: develop binary wheel - allow to use ecmwflibs
Browse files Browse the repository at this point in the history
  • Loading branch information
iainrussell committed Apr 19, 2024
1 parent 06125b8 commit 3914532
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions gribapi/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ def _lookup(name):
return _MAP.get(name, name)


def get_findlibs(name):
try:
import ecmwflibs as findlibs

logging.debug(f"{name} lib search: using ecmwflibs")
except ImportError:
import findlibs

logging.debug(f"{name} lib search: no ecmwflibs, using findlibs")
return findlibs


def find_binary_libs(name):

name = _lookup(name)
Expand All @@ -50,15 +62,8 @@ def find_binary_libs(name):
logging.debug(
f"{name} lib search: ECCODES_PYTHON_USE_INSTALLED_BINARIES set, so using findlibs"
)
try:
import ecmwflibs as findlibs

logging.debug(f"{name} lib search: using ecmwflibs")
except ImportError:
import findlibs

logging.debug(f"{name} lib search: no ecmwflibs, using findlibs")

findlibs = get_findlibs(name)
foundlib = findlibs.find(name)
logging.debug(f"{name} lib search: findlibs returned {foundlib}")
return foundlib
Expand Down

0 comments on commit 3914532

Please sign in to comment.