Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用pybuilder将库绑定到应用程序_Python_Linux_Pybuilder - Fatal编程技术网

Python 使用pybuilder将库绑定到应用程序

Python 使用pybuilder将库绑定到应用程序,python,linux,pybuilder,Python,Linux,Pybuilder,我是python新手,我想为debian编写一个应用程序包。因此,我想(而且必须)使用pybuilder。我的目标是创建一个.deb包(目前正在使用stdeb),以确保也安装了所有必需的库。 我的应用程序使用第三方库,该库仅通过pip(3)安装(无debian软件包)提供 我的build.py看起来像: [...] use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.install_dependen

我是python新手,我想为debian编写一个应用程序包。因此,我想(而且必须)使用pybuilder。我的目标是创建一个.deb包(目前正在使用stdeb),以确保也安装了所有必需的库。
我的应用程序使用第三方库,该库仅通过pip(3)安装(无debian软件包)提供

我的
build.py
看起来像:

[...]
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.distutils")
use_plugin("copy_resources")
use_plugin("source_distribution")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.stdeb")

@init
def initialize(project):
    project.build_depends_on('coverage')
    project.build_depends_on('flake8')
    project.build_depends_on('jsonmerge')
    project.build_depends_on('mock')
    project.build_depends_on('setuptools')
    project.build_depends_on('stdeb')
    project.build_depends_on('unittest-xml-reporting')
    project.build_depends_on('xmlrunner')

    project.depends_on('<pip-only-library>')

    project.set_property('coverage_threshold_warn', 50)
    project.set_property('flake8_break_build', False)
    project.set_property('flake8_ignore', 'E501,E402,E731')
    project.set_property('flake8_include_test_sources', True)
    project.set_property('flake8_verbose_output', True)
    project.set_property('verbose', True)
    project.set_property("copy_resources_target", "$dir_dist")
    project.set_property("coverage_break_build", False)
    project.set_property("coverage_reset_modules", True)
    project.set_property("dir_dist_scripts", 'scripts')

    project.set_property("distutils_classifiers", [
                         'Programming Language :: Python :: 3',
                         'Programming Language :: Python :: 3.3',
                         'Programming Language :: Python :: 3.4',
                         'Development Status :: 4',
                         'Environment :: Console',
                         'Intended Audience :: Systems Administration',
                         'License :: OSI Approved :: BSD License'])

    project.set_property('distutils_commands', ['bdist'])
    project.set_property('distutils_commands', ['sdist'])
# `target/dist/mypackage-1.0/setup.py`
[...]
if __name__ == '__main__':
    setup(
        [...]
        packages = [],
        [...]
        entry_points = {},
        data_files = [],
        package_data = {},
        install_requires = ['pip-only-library'],
        dependency_links = [],
        zip_safe=True,
        cmdclass={'install': install},
    )
使用
sudo dpkg-i python3-mypackage_1.0-1_all.deb测试软件包安装失败,因为dpkg引用了不可用的依赖软件包
python3-

在构建期间,库存在于本地计算机上。 因此,现在出现了一个新手问题:如何更改
build.py
,以确保创建的debian包提供了我的应用程序,并确保满足库要求。
也许,可以将pip-only库(即在构建期间从
/usr/local/lib/python3.4/dist包中获取)捆绑到我的应用程序中,并在“具有所有依赖项的应用程序”包中发布它们吗?还是有其他方法

我已经看过了,但没用