简体   繁体   English

在setup.py中安装另一个源发行版?

[英]Installing another source distribution in setup.py?

I have a dependency that's not on PyPi , but I have it in a source distribution tar file. 我有一个不依赖PyPi的依赖PyPi ,但是我在源代码分发tar文件中有它。 Is there anyway to get setup.py to use the tar to install the dependency? 无论如何,有没有让setup.py使用tar安装依赖项?

This doesn't work because dependency.tar.gz is not available after the project gets into an sdist: 这不起作用,因为在项目进入sdist之后, dependency.tar.gz不可用:

from setuptools.command.install import install

class MyInstall(install):
    def run(self):
        os.system('pip install -U dependency.tar.gz')


setup(
      ...
      cmdclass={'install': MyInstall}
 )

Setuptools documentation actually covers installation of dependencies that aren't registered in PyPI. Setuptools文档实际上涵盖了未在PyPI中注册的依赖项的安装。

http://pythonhosted.org/setuptools/setuptools.html#dependencies-that-aren-t-in-pypi http://pythonhosted.org/setuptools/setuptools.html#dependencies-that-aren-t-in-pypi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM