Skip to content

Wrong interpolation when using factors and variables substitutions #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jd opened this issue Apr 21, 2017 · 2 comments
Closed

Wrong interpolation when using factors and variables substitutions #509

jd opened this issue Apr 21, 2017 · 2 comments

Comments

@jd
Copy link

jd commented Apr 21, 2017

When mixing factor and var subst, it factor are not removed before the var subst it seems.

Here's a following minimal tox.ini to reproduce:

[testenv]
deps = futurist
    mysql: pymysql

[testenv:docs]
deps = {[testenv]deps}
       sphinx

And here's what happens:

GLOB sdist-make: /Users/jd/toxtest/setup.py
docs create: /Users/jd/toxtest/.tox/docs
docs installdeps: futurist, mysql: pymysql, sphinx
ERROR: invocation failed (exit code 1), logfile: /Users/jd/toxtest/.tox/docs/log/docs-1.log
ERROR: actionid: docs
msg: getenv
cmdargs: ['/Users/jd/toxtest/.tox/docs/bin/pip', 'install', 'futurist', 'mysql: pymysql', 'sphinx']
env: {'CPPFLAGS': '-I/usr/local/opt/openssl/include', 'LAST_COMMAND_EXECUTED': 'tox -e docs', 'dist': '/var/cache/pbuilder/base-*.tgz', 'HISTFILE': '/Users/jd/.zsh/history', '__CF_USER_TEXT_ENCODING': '0x1F7:0x0:0x0', 'LC_CTYPE': 'UTF-8', 'TERM_PROGRAM_VERSION': '3.0.14', 'TMPDIR': '/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/', 'ITERM_PROFILE': 'Default', 'LOGNAME': 'jd', 'USER': 'jd', 'RPS1': '${vcs_info_msg_0_} %B%!%b %y %F{red}%*%b%f%', 'PATH': '/Users/jd/toxtest/.tox/docs/bin:/Users/jd/.local/bin:/usr/texbin:/usr/local/bin:/Users/jd/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/texlive/2016/bin/universal-darwin', 'HOME': '/Users/jd', 'PS1': '%(!,%B%F{red},%F{cyan})%m%f %2~ %B%(!.#.\xe2\x9e\x94)%b ', 'DEBFULLNAME': 'Julien Danjou', 'DISPLAY': '/private/tmp/com.apple.launchd.B8CxzxYLWU/org.macosforge.xquartz:0', 'TERM_PROGRAM': 'iTerm.app', 'LANG': 'en_US.UTF-8', 'REPORTTIME': '30', 'TERM': 'xterm-256color', 'Apple_PubSub_Socket_Render': '/private/tmp/com.apple.launchd.xlhLn75S7m/Render', 'COLORFGBG': '7;0', 'TEXINPUTS': '.:/Users/jd/.latex::/usr/local/share/dblatex/latex/style:/usr/local/share/dblatex/latex/misc:/usr/local/etc/asciidoc/dblatex', 'LANGUAGE': 'en_US.UTF-8', 'SHLVL': '1', 'LESS_TERMCAP_me': '\x1b[0m', 'LESS_TERMCAP_md': '\x1b[01;31m', 'SECURITYSESSIONID': '186a5', 'LESS_TERMCAP_mb': '\x1b[01;31m', 'XPC_FLAGS': '0x0', 'HISTSIZE': '5000', 'LAST_COMMAND_START_TIME': '134', 'ITERM_SESSION_ID': 'w0t3p0:AD9B08F6-62DF-4CFF-849B-1B77C6D13A0E', 'PYTHONHASHSEED': '4231315147', 'EDITOR': 'emacsclient -a emacs', 'LDFLAGS': '-L/usr/local/opt/openssl/lib', 'ORGANIZATION': 'Naquadah Network', 'DEBEMAIL': '[email protected]', 'vcs_info_msg_0_': '%F{green}%f%F{red}%f %F{magenta}master%f', 'RRPS1': '${vcs_info_msg_0_} %B%!%b %y %F{red}%*%b%f%', 'TERM_SESSION_ID': 'w0t3p0:AD9B08F6-62DF-4CFF-849B-1B77C6D13A0E', 'QUILT_REFRESH_ARGS': '-p ab --no-timestamps --no-index', 'XPC_SERVICE_NAME': '0', 'VIRTUAL_ENV': '/Users/jd/toxtest/.tox/docs', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.XDTeHoZC1j/Listeners', 'SHELL': '/bin/bash', 'XML_CATALOG_FILES': '/usr/local/etc/xml/catalog', 'QUILT_PATCHES': 'debian/patches', 'PKG_CONFIG_PATH': '/usr/local/opt/openssl/lib/pkgconfig', 'LC_ALL': 'en_US.UTF-8', 'EMAIL': '[email protected]', 'FULLNAME': 'Julien Danjou', '_': '/usr/local/bin/tox', 'BROWSER': 'chromium', 'LESS_TERMCAP_ue': '\x1b[0m', 'b': 'base-*', 'ZLE_LINE_ABORTED': 'cd ', 'OLDPWD': '/Users/jd', 'SAVEHIST': '5000', 'LESS_TERMCAP_se': '\x1b[0m', 'PWD': '/Users/jd/toxtest', 'LESS_TERMCAP_us': '\x1b[01;32m', 'LESS_TERMCAP_so': '\x1b[01;44;33m', 'CLICOLOR': '1', 'vcs_info_msg_1_': ''}

Invalid requirement: 'mysql: pymysql'
Traceback (most recent call last):
  File "/Users/jd/toxtest/.tox/docs/lib/python2.7/site-packages/pip/req/req_install.py", line 82, in __init__
    req = Requirement(req)
  File "/Users/jd/toxtest/.tox/docs/lib/python2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "': pymysq'"


ERROR: could not install deps [futurist, mysql: pymysql, sphinx]; v = InvocationError('/Users/jd/toxtest/.tox/docs/bin/pip install futurist mysql: pymysql sphinx (see /Users/jd/toxtest/.tox/docs/log/docs-1.log)', 1)
______________________________________________ summary ______________________________________________
ERROR:   docs: could not install deps [futurist, mysql: pymysql, sphinx]; v = InvocationError('/Users/jd/toxtest/.tox/docs/bin/pip install futurist mysql: pymysql sphinx (see /Users/jd/toxtest/.tox/docs/log/docs-1.log)', 1)

The command ['/Users/jd/toxtest/.tox/docs/bin/pip', 'install', 'futurist', 'mysql: pymysql', 'sphinx'] seems wrong, indeed.

@obestwalter obestwalter added bug needs:discussion It's not quite clear if and how this should be done and removed needs:discussion It's not quite clear if and how this should be done labels Apr 21, 2017
@obestwalter
Copy link
Member

obestwalter commented Apr 21, 2017

I just tried this with tox down to 1.9 and also with older pip versions. The same error occurs consistently (Invalid requirement, parse error at "': pymysq'").

If we explicitly define the environment in envlist there is no error:

[tox]
skipsdist = True
envlist = mysql
[testenv]
deps =
    futurist
    mysql: pymysql

[testenv:docs]
deps =
    {[testenv]deps}
    sphinx

I just stumbled over different behaviour when doing this kind of "dynamic" environment creation in #505 so this might be a portion of the code that needs some closer looking at and some special TLC to ideally make it behave in the same way as environments created in the envlist. What makes this harder to deal with (I guess - I am not familiar with the affected code yet), is that these specificiers can be factors also.

@obestwalter
Copy link
Member

duplicate of #312.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants