ionelmc / cookiecutter-pylibrary

Enhanced cookiecutter template for Python libraries.
BSD 2-Clause "Simplified" License
1.25k stars 207 forks source link

Multiple extensions modules from different languages #240

Closed jymchng closed 1 year ago

jymchng commented 1 year ago

Hi, I have read your blog post on metaclasses and that on packaging python libraries, the latter led me to here.

The context is, in these days, some projects may be interested in using python as a higher-level abstraction layer, powered by extension modules written in multiple languages, e.g. Cython, Nim, Rust and Cpp, and usually these languages name their source directory as src.

I noted that in your template, you incorporated extensions source files e.g. .pyx in src/nameless.

Let's imagine a project that incorporates multiple languages, for cleanliness, they might want to have separate directories for each language, e.g. one for cython, another for rust. How would you advice them to go about writing their setup.py in this case?

ionelmc commented 1 year ago

"for cleanliness" - what's that?

"usually these languages name their source directory as src" - why is this relevant?

Sounds to me like your trying to get advice on some sort of multilanguage monorepo mess that you're describing as vaguely as possible :-)

jymchng commented 1 year ago

Thank you for your response. Indeed, I have a monorepo that has all sorts of extension modules in different languages. I guess your advice would be to not have such a monorepo in the first place 😆