【发布时间】:2013-04-05 02:16:37
【问题描述】:
当作为 rpm/deb 包安装到系统时,构建 python 应用程序的最佳实践是什么? 应用程序代码大部分是用 Python 编写的,还有一些 shell 脚本、配置文件和日志文件。
我想有如下结构。
- 将 Python 包放在哪里?
- 我需要有应用程序的配置文件,但它会被 Python 包使用。配置文件放在哪里?
/opt/.../app_name-1.0.0/
bin/ /*Here would be few shell scripts I need*/ shell_script_1.sh shell_script_2.sh var/ log/ /* Log files */ app_name.log notifications/ /* notifications, generated by app, temporarily kept */ alert_1.tmp alert_2.tmp etc/ /*python package configuration*/ /*is it better to put this in package dir?*/ app_name.config app_name/ /*Python package, the main content*/ __init__.py app_name.py a.py b.py config_file_reader.py subpackage_1/ __init__.py c.py subpackage_2/ __init__.py d.py
【问题讨论】:
标签: python installation package dir