diff --git a/include/python-cellframe.h b/include/python-cellframe.h index d7d9ce8582cd8f0dfc0e50073b5bc8b9506b63dc..d5439a7e6f320b91bacb00e996499150bfcc6d1c 100644 --- a/include/python-cellframe.h +++ b/include/python-cellframe.h @@ -114,14 +114,14 @@ static PyMethodDef CellFramePythonMethods[] = { static struct PyModuleDef CellFramePythonModule = { PyModuleDef_HEAD_INIT, - "CellFrame", /* name of module */ + "libCellFrame", /* name of module */ NULL, /* module documentation, may be NULL */ -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ CellFramePythonMethods }; -PyMODINIT_FUNC PyInit_CellFrame(void); +PyMODINIT_FUNC PyInit_libCellFrame(void); #ifdef __cplusplus } diff --git a/setup.py b/setup.py index d7673bae5934246015663c07ae4839cf6b77ff22..26f5de9036b5d175fddbef7a94cb3a2fc5528634 100644 --- a/setup.py +++ b/setup.py @@ -73,9 +73,12 @@ setup( author='DEMLABS Inc. (2017-2020)', license="GNU GPLv3", packages=['CellFrame'], - ext_modules=[CMakeExtension('CellFrame')], + ext_modules=[CMakeExtension('CellFrame/libCellFrame')], # add custom build_ext command - cmdclass=dict(build_ext=CMakeBuild), + cmdclass={ + 'build_ext': CMakeBuild + }, +# cmdclass=dict(build_ext=CMakeBuild), zip_safe=False, # tests_require=['pytest'], # setup_requires=setup_requires diff --git a/src/__init__.py b/src/__init__.py index 4e6e61f68ce394fff2a156e04c7176d04252ed04..a6c59c1ee14056d6af117801b941599d1657b064 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1 +1 @@ -from .CellFrame import * +#from .libCellFrame import * diff --git a/src/python-cellframe.c b/src/python-cellframe.c index 608631e12149c843b7624efaf6502eac25b8e924..12f433039fb55bf3c5e5ee76a1d73c3d1dc44d5e 100644 --- a/src/python-cellframe.c +++ b/src/python-cellframe.c @@ -291,7 +291,7 @@ static PyObject *python_cellframe_init(PyObject *self, PyObject *args){ return PyLong_FromLong(0); } -PyMODINIT_FUNC PyInit_CellFrame(void){ +PyMODINIT_FUNC PyInit_libCellFrame(void){ if (PyType_Ready(&DapObject_DapObjectType) < 0 || PyType_Ready(&dapCrypto_dapCryptoType) < 0 || PyType_Ready(&ServerCore_ServerCoreType) < 0 || PyType_Ready(&dapEvents_dapEventsType) < 0 || @@ -459,7 +459,7 @@ int main(int argc, char **argv) { } /* Add a built-in module, before Py_Initialize */ - PyImport_AppendInittab("CellFrame", PyInit_CellFrame); + PyImport_AppendInittab("libCellFrame", PyInit_libCellFrame); /* Pass argv[0] to the Python interpreter */ Py_SetProgramName(program); @@ -470,7 +470,7 @@ int main(int argc, char **argv) { /* Optionally import the module; alternatively, import can be deferred until the embedded script imports it. */ - PyImport_ImportModule("CellFrame"); + PyImport_ImportModule("libCellFrame"); PyMem_RawFree(program); return 0;