adding python src and renamin _ext
This commit is contained in:
parent
1985beca05
commit
9d890adef8
2
Makefile
2
Makefile
@ -7,7 +7,7 @@ debug: ## Build extension with debug prints and assertions
|
|||||||
python setup.py build_ext --inplace -UNDEBUG -DCR_VERBOSE
|
python setup.py build_ext --inplace -UNDEBUG -DCR_VERBOSE
|
||||||
|
|
||||||
clean: ## Remove the build folder and the shared library
|
clean: ## Remove the build folder and the shared library
|
||||||
rm -rf build/ creader.cpython*
|
rm -rf build/ _creader.cpython*
|
||||||
|
|
||||||
test: ## Run unit tests using pytest
|
test: ## Run unit tests using pytest
|
||||||
python -m pytest
|
python -m pytest
|
||||||
|
1
creader/__init__.py
Normal file
1
creader/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from _creader import *
|
2
setup.py
2
setup.py
@ -3,7 +3,7 @@
|
|||||||
import setuptools
|
import setuptools
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
c_ext = setuptools.Extension("creader",
|
c_ext = setuptools.Extension("_creader",
|
||||||
sources = [
|
sources = [
|
||||||
"src/creader_module.c",
|
"src/creader_module.c",
|
||||||
"src/cluster_reader.c",
|
"src/cluster_reader.c",
|
||||||
|
@ -70,7 +70,7 @@ static PyMethodDef creader_methods[] = {
|
|||||||
// Module defenition
|
// Module defenition
|
||||||
static struct PyModuleDef creader_def = {
|
static struct PyModuleDef creader_def = {
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
"creader",
|
"_creader",
|
||||||
module_docstring,
|
module_docstring,
|
||||||
-1,
|
-1,
|
||||||
creader_methods, // m_methods
|
creader_methods, // m_methods
|
||||||
@ -81,7 +81,7 @@ static struct PyModuleDef creader_def = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Initialize module and add classes
|
// Initialize module and add classes
|
||||||
PyMODINIT_FUNC PyInit_creader(void) {
|
PyMODINIT_FUNC PyInit__creader(void) {
|
||||||
|
|
||||||
PyObject *m = PyModule_Create(&creader_def);
|
PyObject *m = PyModule_Create(&creader_def);
|
||||||
if (m == NULL)
|
if (m == NULL)
|
||||||
|
Reference in New Issue
Block a user