How to encrypt a module into one file?
My parts compiled into one file are visible from the outside, but inside the hierarchy is broken.
from .packet import Packet spills over
File "libmodule/__init__.py", line 1, in init libmodule.__init__ (libmodule/__init__.c:1060) ... ImportError: No module named 'libmodule.packet' Here to take
Extension("module", [ "module.py", "libmodule/__init__.py", "libmodule/worker.py", "libmodule/decoders.py", "libmodule/constants.py", ]) and compile into one file. So far it turns out only in 5 files, but it is not very convenient.
As a result, you need to see the setup () function from module.py, the rest does not matter. That is, from libmodule.packet import Packet not necessary to work outside the library.
An example of the structure that I am trying to achieve https://github.com/eri-hellowords/cython-helloword/tree/v1 - does not work
This is how it works, but I don’t like the structure https://github.com/eri-hellowords/cython-helloword/tree/v2.0
Option to drag all the files into one namespace via .pyx: stackoverflow.com/a/19698914/2101808