Skip to content
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

Generative setenv fails if there’s only one variable #190

Closed
pytoxbot opened this issue Sep 17, 2016 · 2 comments
Closed

Generative setenv fails if there’s only one variable #190

pytoxbot opened this issue Sep 17, 2016 · 2 comments

Comments

@pytoxbot
Copy link

Consider this minimal tox.ini:

[tox]
envlist = py27-{a,b}

[testenv]
deps =
    b: pytest
setenv =
    a: A = 1
commands = true

Running tox -l on it fails with

Traceback (most recent call last):
  File "/Users/hynek/.local/bin/tox", line 9, in <module>
    load_entry_point('tox==1.8.0', 'console_scripts', 'tox')()
  File "/Users/hynek/.local/venvs/tox/lib/python2.7/site-packages/tox/_cmdline.py", line 25, in main
    config = parseconfig(args, 'tox')
  File "/Users/hynek/.local/venvs/tox/lib/python2.7/site-packages/tox/_config.py", line 42, in parseconfig
    parseini(config, inipath)
  File "/Users/hynek/.local/venvs/tox/lib/python2.7/site-packages/tox/_config.py", line 296, in __init__
    self._makeenvconfig(name, section, reader._subs, config)
  File "/Users/hynek/.local/venvs/tox/lib/python2.7/site-packages/tox/_config.py", line 354, in _makeenvconfig
    setenv.update(reader.getdict(section, 'setenv'))
  File "/Users/hynek/.local/venvs/tox/lib/python2.7/site-packages/tox/_config.py", line 529, in getdict
    name, rest = line.split('=', 1)
ValueError: need more than 1 value to unpack

while

[tox]
envlist = py27-{a,b}

[testenv]
setenv =
    a: A = 1
    b: B = 1
commands = true

and

[tox]
envlist = py27

[testenv]
setenv =
    A = 1
commands = true

work just fine.

@pytoxbot
Copy link
Author

Original comment by @hpk42

fix issue190: allow setenv to be empty

→ <<cset 69a69d68fc46>>

@pytoxbot
Copy link
Author

Original comment by @hpk42

Even just this fails:

#!python

[testenv]
setenv =
commands = true

But with conditional settings we land in this situation easier. Originally conditional syntax was only targetted at deps but it seems there is a need for other config options as well. cc @Suor

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

1 participant