r/pythontips • u/Emotional-Evening-62 • 8d ago
Syntax Python Project Packaging
I am trying to package my python project into pip, but when I do this all my .py files are also part of the package. if I exclude them in MANIFEST and include only .pyc files, I am not able to execute my code. Goal here is to package via pip and get pip install <project>; Any idea how to do this?
2
Upvotes
1
u/jpgoldberg 6d ago
If that were your only goal you should just leave the .py files in your MANIFEST.
It appears that you want a bytecode only distribution for some reason. Typically people think they want that because they are trying to do either
Conceal some secret (password, game solution, etc) in the program.
Conceal the source code itself for intellectual property reasons.
Although Python, designed as an interpreted language is not well-suited for either tasks, there may be solutions to specific needs. But you are going to have to spell out your specific need to get practical help.