Skip to content

Commit 35f6128

Browse files
committed
Differentiate module and package names
1 parent 81a4224 commit 35f6128

File tree

26 files changed

+65
-65
lines changed

26 files changed

+65
-65
lines changed

tests/packages/importlib_editable/pkg/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
python_add_library(pkg MODULE pkg.c WITH_SOABI)
1+
python_add_library(emod_a MODULE emod_a.c WITH_SOABI)
22

3-
install(TARGETS pkg DESTINATION pkg/)
3+
install(TARGETS emod_a DESTINATION pkg/)
44
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testfile" "This is the file")
55
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/testfile" DESTINATION pkg/)
66

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from . import pkg, pure, subpkg1, subpkg2
1+
from . import emod_a, pmod_a, subpkg1, subpkg2
22

3-
__all__ = ["pure", "pkg", "subpkg1", "subpkg2"]
3+
__all__ = ["emod_a", "pmod_a", "subpkg1", "subpkg2"]

tests/packages/importlib_editable/pkg/pkg.c renamed to tests/packages/importlib_editable/pkg/emod_a.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ static PyObject *square_wrapper(PyObject *self, PyObject *args) {
1212
return PyFloat_FromDouble(result);
1313
}
1414

15-
static PyMethodDef pkg_methods[] = {
15+
static PyMethodDef emod_a_methods[] = {
1616
{"square", square_wrapper, METH_VARARGS, "Square function"},
1717
{NULL, NULL, 0, NULL}};
1818

19-
static struct PyModuleDef pkg_module = {PyModuleDef_HEAD_INIT, "pkg",
20-
NULL, -1, pkg_methods};
19+
static struct PyModuleDef emod_a_module = {PyModuleDef_HEAD_INIT, "emod_a",
20+
NULL, -1, emod_a_methods};
2121

2222
/* name here must match extension name, with PyInit_ prefix */
23-
PyMODINIT_FUNC PyInit_pkg(void) {
24-
return PyModule_Create(&pkg_module);
23+
PyMODINIT_FUNC PyInit_emod_a(void) {
24+
return PyModule_Create(&emod_a_module);
2525
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
python_add_library(subpkg1 MODULE subpkg1.c WITH_SOABI)
1+
python_add_library(emod_b MODULE emod_b.c WITH_SOABI)
22

3-
install(TARGETS subpkg1 DESTINATION pkg/subpkg1)
3+
install(TARGETS emod_b DESTINATION pkg/subpkg1)
44
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testfile" "This is the file")
55
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/testfile" DESTINATION pkg/subpkg1)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from . import pure, subpkg1
1+
from . import emod_b, pmod_b
22

3-
__all__ = ["pure", "subpkg1"]
3+
__all__ = ["emod_b", "pmod_b"]

tests/packages/importlib_editable/pkg/subpkg1/subpkg1.c renamed to tests/packages/importlib_editable/pkg/subpkg1/emod_b.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ static PyObject *square_wrapper(PyObject *self, PyObject *args) {
1212
return PyFloat_FromDouble(result);
1313
}
1414

15-
static PyMethodDef subpkg1_methods[] = {
15+
static PyMethodDef emod_b_methods[] = {
1616
{"square", square_wrapper, METH_VARARGS, "Square function"},
1717
{NULL, NULL, 0, NULL}};
1818

19-
static struct PyModuleDef subpkg1_module = {PyModuleDef_HEAD_INIT, "subpkg1",
20-
NULL, -1, subpkg1_methods};
19+
static struct PyModuleDef emod_b_module = {PyModuleDef_HEAD_INIT, "emod_b",
20+
NULL, -1, emod_b_methods};
2121

2222
/* name here must match extension name, with PyInit_ prefix */
23-
PyMODINIT_FUNC PyInit_subpkg1(void) {
24-
return PyModule_Create(&subpkg1_module);
23+
PyMODINIT_FUNC PyInit_emod_b(void) {
24+
return PyModule_Create(&emod_b_module);
2525
}

0 commit comments

Comments
 (0)