tox.ini是否需要转义URL中的锚(哈希号)? [英] Does tox.ini need escaping for anchors in URLs (hash #)?

查看:64
本文介绍了tox.ini是否需要转义URL中的锚(哈希号)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个像这样的tox.ini

I have a tox.ini like this

[tox]
skipsdist = True
envlist = begin,py35,py36,end

[testenv]
commands =
    pip install -e git+ssh://git@bitbucket.org/org/repo#egg=repo[server]

我收到错误消息

无法检测到"git + ssh://git@bitbucket.org/org/repo.git"的需求名称,请使用#egg = your_package_name指定一个名称

Could not detect requirement name for 'git+ssh://git@bitbucket.org/org/repo.git', please specify one with #egg=your_package_name

看起来非常像#被视为注释.是这样吗我该如何逃脱?

It looks very much as if the # is treated as a comment. Is that the case? How can I escape it?

  • \#:可以识别\,但不能识别其余字符-因此它不是转义字符
  • 引用整个字符串:ERROR: InvocationError: could not find executable 'pip install -e git+ssh://git@bitbucket.org/org/repo.git#egg=repo[server]'
  • \#: The \ is recognized, but not the rest - so it is not an escape character
  • Quoting the whole string: ERROR: InvocationError: could not find executable 'pip install -e git+ssh://git@bitbucket.org/org/repo.git#egg=repo[server]'

推荐答案

我的猜测是尝试引用URL:

My guess was to try quoting the URL:


[testenv]
commands =
    pip install -e "git+ssh://git@bitbucket.org/org/repo#egg=repo[server]"

这似乎可以解决问题.

这篇关于tox.ini是否需要转义URL中的锚(哈希号)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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