-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create a Python extension with multiple files? #647
Comments
Make sure not to run test.py in the same folder as the uncompiled Codon mymodule module. Your example works:
Result:
|
Thank you! Do you know how to import the functions and classes defined in
|
You’ve exposed MyClass and ack in Python intentionally avoids enforcing such constraints, following its ‘we’re all consenting adults’ philosophy. However, Codon’s static nature makes this approach a poor fit—we should prioritize explicit encapsulation. |
Thank you, this helped me understand Codon better. |
Hi! Thanks for the great project.
I'm trying to create a Python package using Codon. I've written a small example that uses multiple files, but I'm confused about how to build it correctly.
Here's my file structure:
__init__.py
main.py
I followed the documentation and created a
setup.py
that builds the extension using Codon.However, when I try to import
MyClass
orack
, I get anImportError
. It seems that only the file specified in the extension (__init__.py
) is being compiled.What's the proper way to build a Codon-based Python extension that includes multiple files?
The full example is here:
👉 https://github.com/sk-uma/codon-pyext-example
Thanks in advance for any help!
The text was updated successfully, but these errors were encountered: