Tox: Using two sets of {a, b, ...} in envlist doesnt show enviroments in tox -l

Created on 18 Jul 2018  Â·  10Comments  Â·  Source: tox-dev/tox

I couldnt find a better place to ask this question, so just let me know if there is a place, then Ill delete this.

I am using tox to run tests, and have a tox.ini with:

[tox]
envlist     =   py{34,35,36,37}-{dev, rel}
skipsdist   =   True

Release and base are defined in here, but they are confidential

[testenv]
deps        =   {[base]deps}
commands    =   py{34,35,36,37}-rel: {[release]commands}
                {[base]commands}
passenv     =   {[base]passenv}
usedevelop  =   py{34,35,36,37}-dev: True
                py{34,35,36,37}-rel: False

When I run
$tox
It starts creating an enviroment called python, and tox -l only shows python, not py34-dev, py-34-rel......

Actual:

$ tox -l
python

What I expected:

$ tox -l
py34-dev
py35-dev
py36-dev
py37-dev
py34-rel
py35-rel
py36-rel
py37-rel

I can run the expected enviroments with

$ tox -e py34-dev

and it will run the enviroment like expected.

Am I setting up stuff wrong, or is this supposed to work like this?

configuration normal reproducer

Most helpful comment

On https://unicodelookup.com/ it is identified as a no-break space:

\x{A0} | no-break space | 0240 | 160 | 0xA0 |  

Unicode Lookup is an online reference tool to lookup Unicode and HTML special characters, by name and number, and convert between their decimal, hexadecimal, and octal bases.

All 10 comments

At a quick glance it seems a bug :thinking: it should work. I'll try to create a MVP for this.

Running tox version 3.1.2

@TheLarsinator seems to work, can you try to create a tox.ini that reproduces this?

 cat tox.ini     
[tox]
envlist     =   py{34,35,36,37}-{dev, rel}
skipsdist   =   True

[base]
deps = 
passenv = 
commands = 

[release]
commands = 

[testenv]
deps        =   {[base]deps}
commands    =   py{34,35,36,37}-rel: {[release]commands}
                {[base]commands}
passenv     =   {[base]passenv}
usedevelop  =   py{34,35,36,37}-dev: True
                py{34,35,36,37}-rel: False

/tmp î‚° tox --version                                                      
3.1.2 imported from /usr/local/lib/python3.6/dist-packages/tox/__init__.py

/tmp î‚° tox -l                                                             
py34-dev
py34-rel
py35-dev
py35-rel
py36-dev
py36-rel
py37-dev
py37-rel

Tried to reproduce, and your tox.ini worked perfectly. Took mine apart section by section by copying in your sections until it worked and checked the diff. So it appears I had a
  character right after envlist, so not a space but some other character that looks like whitespace... That caused the issue. Thanks for the help!

Leaves me with one question, how do I run only the dev enviroment with tox -e without listing py34-dev,py35-dev......

character right after envlist, so not a space but some other character that looks like whitespace...

Really? That's awkward. Could you post a minimal tox.ini in a gist or so with that whitespace? This looks like something that should be caught and prevented.

@TheLarsinator can you give the exact unicode code point and an exact example of this? Would be nice if we throw some better error message in this case. The one below seems to still parse correctly.

[tox]
envlist\u2006= py{34,35,36,37}-{dev, rel}

At the moment we don't have any way to specify environments via some pattern expression or such, there's an issue for it under https://github.com/tox-dev/tox/issues/647.

Here it is, first character after envlist: https://gist.github.com/TheLarsinator/91df483ed95770729992d15bedad87e9

Gist
GitHub is where people build software. More than 28 million people use GitHub to discover, fork, and contribute to over 85 million projects.

EDIT: Ok, that didnt work, Github just keeps converting it to a space...

On https://unicodelookup.com/ it is identified as a no-break space:

\x{A0} | no-break space | 0240 | 160 | 0xA0 |  

Unicode Lookup is an online reference tool to lookup Unicode and HTML special characters, by name and number, and convert between their decimal, hexadecimal, and octal bases.

Seems silently failing on this is an upstream bug and likely effects all applications that use the py.Iniconfig parser (e.g. notable pytest), see https://github.com/RonnyPfannschmidt/iniconfig/issues/4.

Was this page helpful?
0 / 5 - 0 ratings