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

Option -v not recognised by run #2266

Closed
2 of 3 tasks
viraptor opened this issue Apr 5, 2020 · 9 comments
Closed
2 of 3 tasks

Option -v not recognised by run #2266

viraptor opened this issue Apr 5, 2020 · 9 comments
Labels
area/cli Related to the command line kind/bug Something isn't working as expected

Comments

@viraptor
Copy link

viraptor commented Apr 5, 2020

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Fedora 31
  • Poetry version: 1.0.5
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

poetry run does not recognise the global option -v even though it's listed in the documentation:

$ poetry help run
USAGE
  poetry run <args1> ... [<argsN>]
...
GLOBAL OPTIONS
  -v (--verbose)         Increase the verbosity of messages: "-v" for normal output, "-vv" for more verbose output and "-vvv" for debug

If I try to use it, I just get the help message again for the help command itself:

$ poetry -v run pserve development.ini
USAGE
  poetry help [<command1>] ... [<commandN>]
...
@viraptor viraptor added the kind/bug Something isn't working as expected label Apr 5, 2020
@pawamoy
Copy link

pawamoy commented Apr 30, 2020

Additionally, when using poetry run -v PROG ARGS, Poetry will fail with FileNotFoundError, since it's trying to execute -v.

@finswimmer finswimmer added the area/cli Related to the command line label Apr 30, 2020
@n-batalha
Copy link

The same applies to install:

$ poetry -vv install 
USAGE
  poetry help [<command1>] ... [<commandN>]

Using poetry version 1.0.7 (tried 1.0.5 too). The same applies to any verbose level.

This is an issue as I'd like to understand why an install seems never ending.

@finswimmer
Copy link
Member

@n-batalha in your case you can use poetry install -vv.

@n-batalha
Copy link

n-batalha commented Jun 7, 2020

@finswimmer I get a Python exception which I'll perhaps log separately, but thanks! In any case you may want to look into it as poetry -vv install seems a valid invocation according to the docs.

@sinoroc
Copy link

sinoroc commented Nov 10, 2020

I somewhat understand why supporting poetry run -v something is complicated and/or not welcome. But I must say, I never understood why the global options can not be placed before the command, so that poetry -v run something should be possible. It would make sense to place global flags before any specific command. I do not even know if that is true or not, I kind of gave up on trying to understand the CLI logic, it is frustratingly inconsistent to me (I know these things are deceptively hard to handle correctly):

$ poetry -V
Poetry version 1.1.4
$ poetry -v cache list
USAGE
[...]
$ poetry cache -v list
USAGE
[...]
$ poetry cache -vvv list
Too many arguments.
$ poetry cache list -v
pypi

@finswimmer
Copy link
Member

Hello,

I believe this is something that has to be changed in cleo and not in poetry itself.

fin swimmer

@IceTDrinker
Copy link

Any pointers as to where to look to fix this ?

@branchvincent
Copy link
Member

Thanks for the issue. This has been addressed on master and will be released with the upcoming 1.2:

$ poetry --version
Poetry (version 1.2.0a2)
$ poetry -vvv run echo test
Loading configuration file /Users/Branch/Library/Application Support/pypoetry/config.toml
Using virtualenv: /Users/Branch/Code/python-poetry/poetry/.venv
test
$ poetry run -vvv echo test
Loading configuration file /Users/Branch/Library/Application Support/pypoetry/config.toml
Using virtualenv: /Users/Branch/Code/python-poetry/poetry/.venv
test

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli Related to the command line kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

7 participants