Building Python Package
-
git + venv + pybuilder
[1] virtualenv user guide
[2] 廖雪峰-virtualenv
[3] pybuilder tutorial
[4] Managing Your Python Project with Git and PyBuilder
[5] examples -
How to add non-python file into a distribution?
[1] Install additional files
[2] doc
使用project.install_file(target, source)
安装非python文件。
target path
:可以是绝对路径,也可以是相对于安装前缀(/usr/
on most linux systems)。
source path
:必须是distribution directory
目录。因为默认情况下non-python文件未复制到分发目录,因此必须使用copy_resources
插件来包含它们。
use_plugin("copy_resources")
@init
def initialize(project):
project.get_property("copy_resources_glob").append("src/main/resources/my-config.yaml")
project.set_property("copy_resources_target", "$dir_dist")
project.install_file("/etc/defaults", "src/main/resources/my-config.yaml")