通过PIP安装特定于平台的依赖项 [英] Installing platform-specific dependencies through PIP

查看:157
本文介绍了通过PIP安装特定于平台的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在测试中使用的是LDTP,它是针对两个不同平台的两个不同软件包:

I'm using LDTP in my tests and it comes as two different packages for two different platforms:

  • 在Mac OS上为PyAtom;
  • Linux上的LDTP.

碰巧的是,它们都具有特定于平台的二进制文件,因此无法真正安装在其他操作系统上.我的问题是,如何使我的requirements.txt依赖于平台安装软件包?

It so happens, that both of them has platform-specific binaries and can't really be installed on other OSes. My question is, how do I make my requirements.txt to install packages dependent on platform?

理想情况下,它应该类似于:

Ideally it should be something like:

mac:
  -e git+https://github.com/pyatom/pyatom.git@1ca0c6a0343000286a328268899d1aab376d8e82#egg=atomac-master
linux:
  ldtp==3.5.0
holmium.core==0.7.6
pytest==2.5.2
selenium==2.42.1

推荐答案

也许您可以为每个平台要求创建一个文件:

maybe you can create a file for each platform requirements:

requirements-windows.txt
requirements-linux.txt
requirements-mac.txt

然后运行例如:

pip install -r requirements-mac.txt

如果您喜欢...

这篇关于通过PIP安装特定于平台的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆