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

Regression since 2.5.0: empty commands section causes error #454

Closed
asottile opened this issue Feb 12, 2017 · 5 comments
Closed

Regression since 2.5.0: empty commands section causes error #454

asottile opened this issue Feb 12, 2017 · 5 comments

Comments

@asottile
Copy link
Contributor

We often use this pattern such that tox is creating our virtual environments for us:

tox.ini

[tox]
skipsdist = true

[testenv:venv]
deps = pre-commit
commands =

Under 2.4.1

I get (what I expect):

$ tox -e venv
venv recreate: /tmp/fo/.tox/venv
venv installdeps: pre-commit
venv installed: appdirs==1.4.0,aspy.yaml==0.2.2,cached-property==1.3.0,functools32==3.2.3.post2,jsonschema==2.6.0,nodeenv==1.1.2,packaging==16.8,pre-commit==0.12.2,pyparsing==2.1.10,PyYAML==3.12,six==1.10.0,virtualenv==15.1.0
venv runtests: PYTHONHASHSEED='2591024316'
___________________________________ summary ____________________________________
  venv: commands succeeded
  congratulations :)

2.5.0

This is an error:

$ tox -e venv
venv create: /tmp/fo/.tox/venv
venv installdeps: pre-commit
venv installed: appdirs==1.4.0,aspy.yaml==0.2.2,cached-property==1.3.0,functools32==3.2.3.post2,jsonschema==2.6.0,nodeenv==1.1.2,packaging==16.8,pre-commit==0.12.2,pyparsing==2.1.10,PyYAML==3.12,six==1.10.0,virtualenv==15.1.0
ERROR: Commands not specified. Please update relevant section of /tmp/fo/tox.ini
___________________________________ summary ____________________________________
ERROR:   venv: nothing to do

workaround

A (kinda unfortunate) workaround is to do something like:

commands = python -c 'print("done!")'
@obestwalter
Copy link
Member

obestwalter commented Feb 12, 2017

Hi @asottile, that's correct. already identified here, but we should have a proper bug for this. Closed the other one in favour of this.

@obestwalter obestwalter changed the title Intentionally no commands an error (regression 2.4.1->2.5.0) Regression since 2.5.0: empty commands section causes error Feb 12, 2017
@asottile
Copy link
Contributor Author

Since this doesn't seem simple to fix, should we start by reverting #407?

The parser doesn't seem to differentiate between "missing" and "present but empty"

@obestwalter
Copy link
Member

I think that's a good idea, as it is better not to have a regression than a broken new feature.

@asottile
Copy link
Contributor Author

This was reverted in #456 -- perhaps the original issue should be reopened and this one closed?

@obestwalter
Copy link
Member

Done. Thanks @asottile!

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants