I am writing (actually generating) a setup.py script for building a single Python extension with several C++ sources. It is unclear to me what is the relationship between the name specified as the name parameter to distutils.core.setup and the name specified as the name parameter to distutils.core.Extension. So when I have this:
distutils.core.setup(
name = 'Abc',
ext_modules = [
distutils.core.Extension(
name = 'Xyz',
sources = ['a.cpp', 'b.cpp']
)
]
)
What is the relationship between Abc and Xyz, especially with respect to:
- Each other
- The name which will be used to import the extension in Python scripts which use it
- The name of the generated
.pyd(or.so) file
I read this in the documentation of distutils:
Abcis "The name of the package"Xyzis "the full name of the extension, including any packages — ie. not a filename or pathname, but Python dotted name"
Unfortunately, I am not able to decipher my answer from this (possibly because Python is not my primary language and I only use it occasionally).
In case it's relevant, the context is that I am creating a CMake wrapper to incorporate building Python extensions into my project's CMake framework.