如何让 "python setup.py install" 安装源而不是 egg 文件?

how to make "python setup.py install" install source instead of egg file?

我曾经在 python 项目中 运行 python setup.py install,它只会将源移动到 site-packages,但有时它会 mv 一个 egg 文件到 site-packages?

#!/usr/bin/env python
# encoding: utf-8

from setuptools import setup,find_packages

setup(
    name = "ipin_rpc_gen_vector",
    version = "0.0.2",
    packages = find_packages("src"),
    package_dir={"":"src"},
    install_requires=[

    ],
)

那么这背后有什么区别呢?什么时候安装源码,什么时候只安装egg文件?如何强制安装源而不是 egg 文件?

如果您想避免 zip(鸡蛋)行为,您必须将 zip_safe 标志设置为 False

您可以在 https://setuptools.readthedocs.io/en/latest/userguide/miscellaneous.html#setting-the-zip-safe-flag 阅读更多相关信息。

另请查看 https://setuptools.readthedocs.io/en/latest/userguide/keywords.html#new-and-changed-setup-keywords and the *_package_data flags (also at: https://setuptools.readthedocs.io/en/latest/references/keywords.html)。