Does tox.ini need escaping for anchors in URLs (hash #)?

孤街浪徒 提交于 2019-12-31 06:09:52

问题


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]

and I get the error

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?

What I tried

  • \#: 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]'

回答1:


My guess was to try quoting the URL:

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

and that seems to do the trick.



来源:https://stackoverflow.com/questions/52723919/does-tox-ini-need-escaping-for-anchors-in-urls-hash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!