我目前正在使用本指南来打包我的项目wasp。然而,目前一切都存在于wasp
文件中。
这并不理想。我宁愿将所有类放在单独的文件中,以便更有效地管理它。我在debian目录中有一系列所需的文件。但是我不确定如何配置打包来打包多个文件。
有没有办法改变我的包装来包装不仅仅是一个脚本文件?
I'm not a debian package or Python expert, but one way would be to copy the various source files to another location (outside of /usr/bin), and then have /usr/bin/wasp call out to them.
Say you put all of your python code in src/
in the root of your repo. In the debian/install
file, you'd have:
wasp usr/bin
src/* usr/lib/wasp/
You'd then just need /usr/bin/wasp
to call some entry point in src
. For example,
#!/usr/bin/python3
import sys
sys.path.append('/usr/lib/wasp/')
import wasp # or whatever you expose in src
# ...
Again, I don't know the best practices here (either in directory or python usage) but I think this would at least work!