Closed dpdani closed 9 months ago
I don't think there's a right or wrong answer, it just comes down to preference.
(As long as you don't put the .c files in the src/py_package
folder, because that would cause them to be included when installing the Python package, which is probably not what you want.)
The structure you propose looks good to me.
The reasons why I use a separate src-python
folder in the example are 1. to show that you can select a custom folder if you want to, and 2. because in my personal projects, the interesting code is usually in the C++ source files, so I like to keep it separate from the (less interesting) Python wrapping scripts.
Thank you for the clarification 🙏
What happens when one puts C files in e.g. the src/py_package
folder above?
Included = shipped with the sdist?
Not just in the sdist (you want them to be in the sdist), but also in the compiled wheels, meaning that they will be installed to the user's site-packages
folder alongside the .py
files of your project.
But only implies that the user will receive the source alongside the compiled .so
in the wheel file.
As far as I understand, it wouldn't break anything. Right?
Exactly.
Thanks!
Hello 👋
Just a question, more than an issue.
In the
minimal
example (as well as the others, but this is the one I read through), thesrc
folder containing source files to be compiled is separated from asrc-python
folder containing the python package itself.Intuitively, I was going to put extension files together with python files. Would this be a bad idea?
Also, assuming separation is nice, would there be a counter-point to having a structure like this?