Building Python Package with Pybuilder

Reason is the light and the light of life.

Jerry Su Oct 03, 2018 1 mins

Building Python Package

使用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")

Read more:

Related posts: