Skip to content

Commit

Permalink
ECC-1793: develop binary wheel - macos arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
iainrussell committed Apr 8, 2024
1 parent 71a5c4e commit b15a7d7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions eccodes/_eccodes.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <stdio.h>
#include <Python.h>

#include <eccodes.h>

static PyObject *versions(PyObject *self, PyObject *args)
{
long s = grib_get_api_version(); // Force linking

return Py_BuildValue("{s:s}",
"eccodes", ECCODES_VERSION_STR);
}

static PyMethodDef eccodes_methods[] = {
{
"versions",
versions,
METH_NOARGS,
"Versions",
},
{
0,
}};

static struct PyModuleDef eccodes_definition = {
PyModuleDef_HEAD_INIT,
"eccodes",
"Load ecCodes library.",
-1,
eccodes_methods};

PyMODINIT_FUNC PyInit__eccodes(void)
{
Py_Initialize();
return PyModule_Create(&eccodes_definition);
}

0 comments on commit b15a7d7

Please sign in to comment.