Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
627f086
Merge branch 'develop'
shahramn Jul 3, 2019
08fd718
Merge branch 'develop'
shahramn Jul 5, 2019
9225666
Update version
shahramn Sep 26, 2019
1c18b44
Merge branch 'release/0.9.3'
shahramn Oct 2, 2019
c8a53ee
Update release date
shahramn Oct 2, 2019
77da4e4
Release 0.9.4
shahramn Nov 21, 2019
a7d7517
Release 0.9.4 min. reqd. version
shahramn Nov 21, 2019
cc7c02a
Release 0.9.4
shahramn Nov 27, 2019
0a4a0d4
Release 0.9.5
shahramn Jan 13, 2020
96be36f
Change default target to 'eccodes ' on PyPi
StephanSiemen Jan 16, 2020
1ffad53
Update date
shahramn Mar 3, 2020
689a249
Update version
shahramn Mar 3, 2020
970ff1f
Update release date
shahramn Mar 5, 2020
9ad8150
Release 0.9.6
shahramn Mar 5, 2020
c9bf96b
Merge branch 'master' of github.com:ecmwf/eccodes-python
avibahra Mar 9, 2020
cad0c68
VERSION - 0.9.7
StephanSiemen Mar 9, 2020
2e45aaa
Date of release
shahramn Jun 21, 2020
7e92554
Merge hotfix/0.9.8
shahramn Jun 23, 2020
2e2e9af
Fix version
shahramn Jun 24, 2020
3513c52
Release 0.9.9
shahramn Aug 3, 2020
6fb8260
Merge branch 'master' of https://github.com/ecmwf/eccodes-python
shahramn Aug 3, 2020
fdecf42
Merge branch 'release/1.0.0'
shahramn Oct 14, 2020
e0d76c7
Update changelog
shahramn Oct 14, 2020
f2c4125
Update Changelog
shahramn Jan 9, 2021
857a828
Update version and release date
shahramn Jan 19, 2021
e7e7138
Release 1.1.0
shahramn Jan 19, 2021
8a5823e
Update changelog
shahramn Mar 22, 2021
ecf8deb
Merge release/1.2.0
shahramn Mar 22, 2021
5edecee
Use `findlibs` to load eccodes library
b8raoult Mar 30, 2021
82dfac0
Merge branch 'develop' into develop
b8raoult Mar 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Changelog for eccodes-python
============================


1.3.0 (2021-mm-dd)
--------------------

Expand Down
44 changes: 12 additions & 32 deletions gribapi/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,19 @@

LOG = logging.getLogger(__name__)

ffi = cffi.FFI()
CDEF = pkgutil.get_data(__name__, "grib_api.h")
CDEF += pkgutil.get_data(__name__, "eccodes.h")
ffi.cdef(CDEF.decode("utf-8").replace("\r", "\n"))

try:
from ._bindings import ffi, lib
except ModuleNotFoundError:
ffi = cffi.FFI()
CDEF = pkgutil.get_data(__name__, "grib_api.h")
CDEF += pkgutil.get_data(__name__, "eccodes.h")
ffi.cdef(CDEF.decode("utf-8").replace("\r", "\n"))

LIBNAMES = ["eccodes", "libeccodes.so", "libeccodes"]

try:
import ecmwflibs

LIBNAMES.insert(0, ecmwflibs.find("eccodes"))
except Exception:
pass

if os.environ.get("ECCODES_DIR"):
eccdir = os.environ["ECCODES_DIR"]
LIBNAMES.insert(0, os.path.join(eccdir, "lib/libeccodes.so"))
LIBNAMES.insert(1, os.path.join(eccdir, "lib64/libeccodes.so"))

lib = None
for libname in LIBNAMES:
try:
lib = ffi.dlopen(libname)
LOG.info("ecCodes library found using name '%s'.", libname)
break
except OSError:
LOG.info("ecCodes library not found using name '%s'.", libname)
pass
if lib is None:
raise RuntimeError(f"ecCodes library not found using {LIBNAMES}")
import ecmwflibs as findlibs
except ImportError:
import findlibs

lib = findlibs.find("eccodes")
if lib is None:
raise RuntimeError("Cannot find eccodes library")

# default encoding for ecCodes strings
ENC = "ascii"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def parse_version_from(path):
"attrs",
"cffi",
"numpy",
"findlibs",
],
tests_require=[
"pytest",
Expand Down