-
-
Notifications
You must be signed in to change notification settings - Fork 526
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 on #1529
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
requested review from
asottile,
gaborbernat and
obestwalter
as code owners
February 19, 2020 07:38
gaborbernat
approved these changes
Feb 19, 2020
gaborbernat
reviewed
Mar 21, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is on hold until we fix the master CI. This also needs a test.
gaborbernat
requested changes
Mar 22, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs test 👍
Signed-off-by: Bernat Gabor <[email protected]>
gaborbernat
force-pushed
the
jquast-patch-1
branch
from
March 23, 2020 10:49
e691988
to
d60cff1
Compare
released via https://pypi.org/project/tox/3.14.6/ |
ssbarnea
pushed a commit
to ssbarnea/tox
that referenced
this pull request
Apr 19, 2021
* fix 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 ``` * trying to follow contributing guidelines * add test, fails without merge, succeeds after Signed-off-by: Bernat Gabor <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1343. When running
tox -l
with a tox.ini file not containing any default environments, instead of an empty output, an exception is raised:This change resolves the issue by setting the value of
max_length
to 0 when default and extra are empty.