问题描述
我隐约记得某种可以从distutils源生成.egg文件的setuptools包装器。有人可以慢跑我的记忆吗?
I vaguely remember some sort of setuptools wrapper that would generate .egg files from distutils source. Can someone jog my memory?
推荐答案
setuptools在导入distutils时对其进行修补。当您使用easy_install从PyPI获取基于distutils的项目时,它将创建一个鸡蛋(pip也可以这样做)。要在本地(例如,在代码签出目录或解压缩的tarball目录中)执行相同操作,请使用以下技巧: python -c import setuptools; execfile('setup.py') bdist_egg
。
setuptools monkey-patches some parts of distutils when it is imported. When you use easy_install to get a distutils-based project from PyPI, it will create an egg (pip may do that too). To do the same thing locally (i.e. in a directory that’s a code checkout or an unpacked tarball), use this trick: python -c "import setuptools; execfile('setup.py')" bdist_egg
.
这篇关于如何从distutils源码包创建Python鸡蛋?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!