Python打包分发工具setuptools

Posted wenlin-gk

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python打包分发工具setuptools相关的知识,希望对你有一定的参考价值。

import sys
import platform
from setuptools import setup, find_packages

def get_test_deps():
    test_deps = [
        pylint == 1.7.2,
        mock == 2.0.0,
        pytest-xdist
    ]

    if sys.version_info < (3,):
        test_deps.append(futures == 3.1.1)

    return test_deps

def get_data_files1():
    if platform.system() != Linux:
        return None

    return [
        (/etc/aidfs.aip, [readme.txt]),
        (/etc/aidfs.aip/config, [cfg/aidfs/config/aidfs.yaml])
        ]

test_deps = get_test_deps()

extras = {test: test_deps}

install_requires = [
    tornado == 4.5.2,
    click == 6.7,
    PyYAML == 3.10,
    urllib3 == 1.22,
    threadpool == 1.3.2
]

entry_points = {
    console_scripts: [
        aidfs = src.cmd.aidfs:cli
    ]
}

setup(
    name=aidfs,
    version=1.0.0,
    packages=find_packages(),
    include_package_data=True,
    install_requires=install_requires,
    tests_require=test_deps,
    extras_require=extras,
    data_files=get_data_files1(),
    entry_points=entry_points,
    author="ZTE",
    author_email="[email protected]",
    description=""
)

 

以上是关于Python打包分发工具setuptools的主要内容,如果未能解决你的问题,请参考以下文章

setuptools包的使用

Python打包工具setuptools的使用

python库打包与发布 setup

python库打包与发布 setup

python模块的打包setuptools

[工具] 利用setuptools打包python程序