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

tox quickstart: error: the following arguments are required: root #3143

Closed
feha opened this issue Oct 27, 2023 · 3 comments
Closed

tox quickstart: error: the following arguments are required: root #3143

feha opened this issue Oct 27, 2023 · 3 comments

Comments

@feha
Copy link

feha commented Oct 27, 2023

Issue

I ran tox quickstart as described in https://tox.wiki/en/4.11.3/user_guide.html

and get the error tox quickstart: error: the following arguments are required: root.

It seems that either the (supposedly optional) arg is broken or the documentation should be updated?

Additionally, I tried explicitly giving the --root argument, with absolutely no change in the output (it still gives the same error

(venv) [project_dir]>tox quickstart
ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at [project_dir]
usage: tox quickstart [-h] [--colored {yes,no}] [--exit-and-dump-after seconds] [-c file] [--workdir dir] [--root dir] [--runner {virtualenv}] [-v | -q] [--version] [--no-provision [REQ_JSON]] [--no-recreate-provision] [-r] [-x OVERRIDE]
                      root
tox quickstart: error: the following arguments are required: root

The error about no pyproject.toml is erronous, as the project has a pyproject.toml in the same directory I used the command. But I tried renaming it to pyproject.toml.bak to be certain it wasn't causing issues, and I get the exact same results.

Note that the EXACT same error occurs even if I do

(venv) [project_dir]>tox quickstart -root [project_dir]
ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at [project_dir]
usage: tox quickstart [-h] [--colored {yes,no}] [--exit-and-dump-after seconds] [-c file] [--workdir dir] [--root dir] [--runner {virtualenv}] [-v | -q] [--version] [--no-provision [REQ_JSON]] [--no-recreate-provision] [-r] [-x OVERRIDE]
                      root
tox quickstart: error: the following arguments are required: root

Related?

#3084 - Only result I found in google when searching this error, and seems very similar to the issues I am experiencing. But it was fixed in Aug 2.

Environment

Provide at least:

  • OS: Windows 10
  • tox version: 4.11.3 (from --version)
Output of pip list of the host Python, where tox is installed Note that the error occurs outside `venv` too, using one here only to simplify the list to as small and example as possible for easier troubleshooting (default packages when creating a new venv + tox & its dependencies).
(venv) [project_dir]>pip list
Package       Version
------------- -------
cachetools    5.3.2
chardet       5.2.0
colorama      0.4.6
distlib       0.3.7
filelock      3.12.4
packaging     23.2
pip           23.3.1
platformdirs  3.11.0
pluggy        1.3.0
pyproject-api 1.6.1
setuptools    68.2.2
tomli         2.0.1
tox           4.11.3
virtualenv    20.24.6
wheel         0.41.2

Output of running tox

Output of tox -rvv
(venv) [project_dir]>tox quickstart -rvv
ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at [project_dir]
usage: tox quickstart [-h] [--colored {yes,no}] [--exit-and-dump-after seconds] [-c file] [--workdir dir] [--root dir] [--runner {virtualenv}] [-v | -q] [--version] [--no-provision [REQ_JSON]] [--no-recreate-provision] [-r] [-x OVERRIDE]
                      root
tox quickstart: error: the following arguments are required: root

Minimal example

virtualenv venv
venv\Scripts\activate
pip install tox
tox quickstart
@jugmac00
Copy link
Member

This should have been fixed in #3123 by @Tbruno25 - but I just verified, it is broken.

There is an explicit test

def test_quickstart_no_args(tox_project: ToxProjectCreator) -> None:
    outcome = tox_project({}).run("q")
    breakpoint()
    outcome.assert_success()

which does not fail, and when stepping in I see

py311: commands[0]> pytest -k test_quickstart
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.11.6, pytest-7.4.3, pluggy-1.3.0
cachedir: .tox/py311/.pytest_cache
rootdir: /home/jugmac00/Projects/tox
configfile: pyproject.toml
testpaths: tests
plugins: cov-4.1.0, time-machine-2.13.0, flaky-3.7.0, xdist-3.3.1, mock-3.12.0, devpi-server-6.9.2
collected 1687 items / 1683 deselected / 4 selected                                                                                                                                          

tests/session/cmd/test_quickstart.py ...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /home/jugmac00/Projects/tox/tests/session/cmd/test_quickstart.py(61)test_quickstart_no_args()
-> outcome.assert_success()
(Pdb) outcome
code: 0
cmd: /home/jugmac00/Projects/tox/.tox/py311/bin/python -m tox q
cwd: /tmp/pytest-of-jugmac00/pytest-0/test_quickstart_no_args0/p
standard output
ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at /tmp/pytest-of-jugmac00/pytest-0/test_quickstart_no_args0/p
tox 4.11.4.dev9+g0a2a3866.d20231027 quickstart utility, will create /tmp/pytest-of-jugmac00/pytest-0/test_quickstart_no_args0/p/tox.ini:
[tox]
env_list =
    py311
minversion = 4.11.4.dev9

[testenv]
description = run the tests with pytest
package = wheel
wheel_build_env = .pkg
deps =
    pytest>=6
commands =
    pytest {tty:--color=yes} {posargs}

which looks good.

This needs some closer look, for which I won't have time the next three weeks at least.

@jugmac00
Copy link
Member

Ah... it just has not been released :-)

https://tox.wiki/en/latest/changelog.html

@jugmac00
Copy link
Member

Closing as a dupe of #3123 - I will have a look whether I can do a release tomorrow, or otherwise @gaborbernat can do it.

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