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

[docs] Add a verbose explanation on how tox exec works #3403

Open
webknjaz opened this issue Oct 11, 2024 · 2 comments
Open

[docs] Add a verbose explanation on how tox exec works #3403

webknjaz opened this issue Oct 11, 2024 · 2 comments

Comments

@webknjaz
Copy link
Contributor

This docs section https://tox.wiki/en/latest/cli_interface.html#tox-exec-(e) does not actually show how to pass a command in (it's not in the signature). And it doesn't explain if the default commands are executed. It documents --notest in the signature, which makes it confusing — does the passed command replace the defined ones or does it augment them? What about commands_pre?

From what I saw in the wild (https://github.com/jamescooke/flake8-aaa/blob/master/Makefile#L42C2-L42C10), the command to execute should be passed after --. But that's a typical syntax for {posargs}. So how do these parts play together?

@webknjaz
Copy link
Contributor Author

Alright… I played with it, and it seems that it replaces commands_pre, commands and commands_post.

Interestingly, passing --notest to tox makes it skip executing the command:

$ tox e -e pre-commit -qq -- python -c 'print("eh?")'
eh?

$ tox e -e pre-commit -qq --notest -- python -c 'print("eh?")'

@gaborbernat
Copy link
Member

Yeah, no tests probably shouldn't be allowed to be called and otherwise just replaces the commands with something passed in from the CLI.

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

No branches or pull requests

2 participants