如何在Python中创建构建的发行版?

时间:2014-03-06 04:01:25

标签: python django python-2.7 amazon-web-services distutils

我有一个Python项目,我已经工作了三个月,该项目包含几个模块,供我们的团队部署我们的软件并在AWS上运行比例测试。 现在我想获取源代码,将其编译成二进制发行版并将所有模块捆绑在那里,就像python库的完成方式一样。这适用于Unix系统。 因此,假设其中一个模块名为cluster.py,另一个scale.py ...如果我想在AWS中创建一个集群,我会运行:

python cluster.py <args>

我一直在阅读Python中的dist,我想完成Python库的工作方式: 用户下载软件包,比如说.zip文件,然后运行:

python setup.py build

然后

python setup.py install

所以用户可以从命令行执行:

cluster <args>

因此,随着我添加更多功能,它们将全部捆绑到包中。但是,要安装所有库和其他依赖项,我使用另一个名为deploy.py的python脚本。因此构建步骤几乎包括deploy.py

from setuptools import setup, find_packages
setup(
    name = "Tools",
    version = "1.0",
    packages = find_packages(),
    scripts = ['deploy.py', 'cluster.py'],

    # Project uses reStructuredText, so ensure that the docutils get
    # installed or upgraded on the target machine
    install_requires = ['docutils>=0.3'],

    package_data = {
    },

    # metadata for upload to PyPI
    author = "Me",
    author_email = "me@example.com",
    description = "This is an Example Package",
    license = "PSF",
    keywords = "hello world example examples",
    url = "http://example.com/HelloWorld/",   # project home page, if any

    # could also include long_description, download_url, classifiers, etc.
)

0 个答案:

没有答案
相关问题