multi-dimensional syntax doesn't work for recreate (others?)

Issue #188 on hold
Mike Bayer created an issue

Doing well with 1.8's multidimensional feature. However it does not seem to work for the "recreate" flag- this is a scalar, not a list, key, but as the docs say the feature should work for "basepython" it would seem this should work:

[tox]
minversion=1.8.dev1
envlist = py{27,33}-sqla{079,084,09,10}, coverage

[testenv]
deps=pytest
     mock
     sqla079: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_7_9
     sqla084: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_8_4
     sqla09: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_9
     sqla10: git+http://git.sqlalchemy.org/sqlalchemy.git@master

# this is the part that fails, tried py{27,33}-sqla{10}, etc. and many
# other combinations, tried fixing in _config.py source... no dice
recreate=
    sqla10: True

sitepackages=True
usedevelop=True

commands=
  py{27,33}-sqla{084,09,10}: python -m pytest -n 4 {posargs}
  py{27,33}-sqla{079}: python -m pytest {posargs}

with the recreate directive using a multidimensional value I get:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/tox", line 9, in <module>
    load_entry_point('tox==1.8.0.dev1', 'console_scripts', 'tox')()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_cmdline.py", line 25, in main
    config = parseconfig(args, 'tox')
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 42, in parseconfig
    parseini(config, inipath)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 293, in __init__
    self._makeenvconfig(name, section, reader._subs, config)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 337, in _makeenvconfig
    vc.recreate = reader.getbool(section, "recreate", False)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tox/_config.py", line 609, in getbool
    "boolean value %r needs to be 'True' or 'False'")
tox.ConfigError: ConfigError: boolean value %r needs to be 'True' or 'False'

not sure if there's some syntactical trick to make it work but I tried pretty hard. everything works great if I just go oldschool with that one directive:

[tox]
minversion=1.8.dev1
envlist = py{27,33}-sqla{079,084,09,10}, coverage

[testenv]
deps=pytest
     mock
     sqla079: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_7_9
     sqla084: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_8_4
     sqla09: git+http://git.sqlalchemy.org/sqlalchemy.git@rel_0_9
     sqla10: git+http://git.sqlalchemy.org/sqlalchemy.git@master


sitepackages=True
usedevelop=True

commands=
  py{27,33}-sqla{084,09,10}: python -m pytest -n 4 {posargs}
  py{27,33}-sqla{079}: python -m pytest {posargs}


[testenv:py27-sqla10]
recreate=True

[testenv:py27-sqla09]
recreate=True

[testenv:py33-sqla10]
recreate=True

[testenv:py33-sqla09]
recreate=True

Comments (8)

  1. Holger Krekel repo owner

    Looked again. Problem is the definition of recreate is not complete. If "sqla10" is not contained as a factor, then the value of recreate is "" (empty string) leading to the error you see. For booleans we can probably rather default to use the default. We don't have negation so expressing "not sqla10" means enumerating all other combinations.

  2. Mike Bayer reporter

    OK...as I read that and started typing I began to understand what you meant, you're saying I'd have to ensure every possible combination is fulfilled...like this would work, right?

    recreate=
        sqla10: True
        sqla{079,084,09}: False
    

    I get that.

  3. Holger Krekel repo owner

    yes, but it's already fixed now, you don't need to list the alternative (see changeset above).

  4. Mike Bayer reporter

    yup...was just curious what would have made it work earlier....thanks! do you have an impression when you might put tox 1.8 out?

  5. Log in to comment