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

fix ValueError: max() arg is an empty sequence #1

Closed
wants to merge 1 commit into from

Conversation

jquast
Copy link
Owner

@jquast jquast commented Feb 19, 2020

Closes tox-dev#1343.

When running tox -l with a tox.ini file not containing any default environments, instead of an empty output, an exception is raised:

$ tox -l
tox -l
Traceback (most recent call last):
  File "/Users/jq/.pyenv/versions/py38/bin/tox", line 8, in <module>
    sys.exit(cmdline())
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 44, in cmdline
    main(args)
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 68, in main
    exit_code = session.runcommand()
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 189, in runcommand
    self.showenvs(all_envs=False, description=show_description)
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 293, in showenvs
    show_envs(self.config, all_envs=all_envs, description=description)
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/commands/show_env.py", line 14, in show_envs
    max_length = max((len(env) for env in (default + extra)))
ValueError: max() arg is an empty sequence

When running `tox -l` with a tox.ini file not containing any default environments, instead of an empty output, an exception is raised:

```
$ tox -l
tox -l
Traceback (most recent call last):
  File "/Users/jq/.pyenv/versions/py38/bin/tox", line 8, in <module>
    sys.exit(cmdline())
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 44, in cmdline
    main(args)
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 68, in main
    exit_code = session.runcommand()
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 189, in runcommand
    self.showenvs(all_envs=False, description=show_description)
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/__init__.py", line 293, in showenvs
    show_envs(self.config, all_envs=all_envs, description=description)
  File "/Users/jq/.pyenv/versions/3.8.1/envs/py38/lib/python3.8/site-packages/tox/session/commands/show_env.py", line 14, in show_envs
    max_length = max((len(env) for env in (default + extra)))
ValueError: max() arg is an empty sequence
```
@jquast jquast closed this Feb 19, 2020
@jquast jquast deleted the jquast-patch-1 branch February 19, 2020 07:24
@jquast jquast restored the jquast-patch-1 branch February 19, 2020 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tox -l: ValueError: max() arg is an empty sequence
1 participant