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

Passing project path causes tox to fail. #31

Open
terjekv opened this issue Jan 7, 2023 · 7 comments
Open

Passing project path causes tox to fail. #31

terjekv opened this issue Jan 7, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@terjekv
Copy link

terjekv commented Jan 7, 2023

Bug description

Running tox adds the project path as an argument without prefixing it with --, which tox 4.2.3 (at least) doesn't like.

To Reproduce

(env) ➜  testproj main ✓$ tox -e format [...]/projects/private/testproj
usage: tox [-h] [--colored {yes,no}] [-v | -q] [--exit-and-dump-after seconds] [-c file] [--workdir dir] [--root dir] [--runner {virtualenv}] [--version] [--no-provision [REQ_JSON]] [--no-recreate-provision] [-r] [-x OVERRIDE]
           {run,r,run-parallel,p,depends,de,list,l,devenv,d,config,c,quickstart,q,exec,e,legacy,le} ...
tox: error: unrecognized arguments: [...]/projects/private/testproj
hint: if you tried to pass arguments to a command use -- to separate them from tox ones

Expected behavior

A working tox. :)

Additional context

Using tox -e format -- [...]/projects/private/testproj works.

@terjekv terjekv added the bug Something isn't working label Jan 7, 2023
@The-Compiler
Copy link
Owner

I don't quite follow - you are running tox from the extension and passing the project path as additional arguments in the VSCode UI?

@terjekv
Copy link
Author

terjekv commented Jan 8, 2023

I'm running Tox from the extension, either via the "play" buttons in the "testing" interface from the main side bar, or from hitting the "play" button in the tox file itself.

@The-Compiler
Copy link
Owner

Alright, but where is the path coming from? Because it's not the extension adding it...

@terjekv
Copy link
Author

terjekv commented Jan 8, 2023

Huh. That is a good question. I have installed the extension and done no configuration at all. The path is the path of the project so it's getting something "correct" from somewhere.

@The-Compiler
Copy link
Owner

Ah! I can indeed reproduce when using it that way, personally I've ever only used the commands via the command palette (or keybindings in my case).

When running tox from the tests interface, It looks like the directory is indeed added here:

runTox([test.label], cwd);

I believe this is due to 0b558fa (which added the testing integration) not accounting for the changes in b6a92ef (which adds a second argument toxArguments to runTox). Thus, cwd now gets passed as toxArguments instead of projDir.

@starlord-daniel if you have the bandwidth to confirm that I'm on the right track there, and/or to open a PR with a fix, that'd be most appreciated! If not, I'm going to go ahead with a fix once I find the time to work on this extension again, but it might be a bit, as I'm very busy until March again.

@terjekv
Copy link
Author

terjekv commented Jan 8, 2023

Ah, thanks for the digging. Good to know I wasn't going insane. :)

@starlord-daniel
Copy link
Contributor

@The-Compiler Yes, that seems to be the issue. Unfortunately I don't have any bandwidth right now. Happy to review though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants