File: builder.py

package info (click to toggle)
eccodes-python 2%3A2.39.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,856 kB
  • sloc: python: 3,455; sh: 326; ansic: 276; makefile: 81; cpp: 30
file content (19 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import logging
import sys

import cffi

ffibuilder = cffi.FFI()
ffibuilder.set_source(
    "gribapi._bindings",
    "#include <eccodes.h>",
    libraries=["eccodes"],
)
ffibuilder.cdef(open("gribapi/grib_api.h").read() + open("gribapi/eccodes.h").read())

if __name__ == "__main__":
    try:
        ffibuilder.compile(verbose=True)
    except Exception:
        logging.exception("can't compile ecCodes bindings")
        sys.exit(1)