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

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

Closed
TheLarsinator opened this issue Jul 18, 2018 · 10 comments
Labels
area:configuration bug:normal affects many people or has quite an impact needs:reproducer ideally a failing test marked as xfail. If that is not possible exact instructions to reproduce

Comments

@TheLarsinator
Copy link

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?

@gaborbernat
Copy link
Member

gaborbernat commented Jul 18, 2018

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

@gaborbernat gaborbernat added bug:normal affects many people or has quite an impact area:configuration labels Jul 18, 2018
@TheLarsinator
Copy link
Author

Running tox version 3.1.2

@gaborbernat
Copy link
Member

@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

@gaborbernat gaborbernat added the needs:reproducer ideally a failing test marked as xfail. If that is not possible exact instructions to reproduce label Jul 18, 2018
@TheLarsinator
Copy link
Author

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!

@TheLarsinator
Copy link
Author

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

@obestwalter
Copy link
Member

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.

@gaborbernat
Copy link
Member

@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 #647.

@TheLarsinator
Copy link
Author

TheLarsinator commented Jul 18, 2018

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...

@TheLarsinator
Copy link
Author

TheLarsinator commented Jul 18, 2018

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.

@gaborbernat
Copy link
Member

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 pytest-dev/iniconfig#4.

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:configuration bug:normal affects many people or has quite an impact needs:reproducer ideally a failing test marked as xfail. If that is not possible exact instructions to reproduce
Projects
None yet
Development

No branches or pull requests

3 participants