-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ECC-1793: develop binary wheel - macos arm64
- Loading branch information
1 parent
71a5c4e
commit b15a7d7
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |