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

poetry show gives clickit "NoSuchOptionException(name)" error #5240

Closed
swills1 opened this issue Feb 27, 2022 · 4 comments · Fixed by #5242
Closed

poetry show gives clickit "NoSuchOptionException(name)" error #5240

swills1 opened this issue Feb 27, 2022 · 4 comments · Fixed by #5242
Assignees
Labels
kind/bug Something isn't working as expected

Comments

@swills1
Copy link

swills1 commented Feb 27, 2022

  • [x ] I am on the latest Poetry version.

  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.

  • [ x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Fedora 35

  • Poetry version: 3.10.1

  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

Hello.

I am getting this clickit error;

NoSuchOptionException

  The "--show" option does not exist.

  at ~/.local/lib/python3.10/site-packages/clikit/args/default_args_parser.py:300 in _add_long_option
      296│     def _add_long_option(
      297│         self, name, value, tokens, fmt, lenient
      298│     ):  # type: (str, Optional[str], List[str], ArgsFormat, bool) -> None
      299│         if not fmt.has_option(name):
    → 300│             raise NoSuchOptionException(name)
      301│ 
      302│         option = fmt.get_option(name);
      303│ 
      304│         if value is False:

These are the steps to reproduce

poetry new packagename
cd packagename
poetry shell
poetry --show

This isn't preventing work, I just wanted to report it. I did search issues, but I may have missed one talking about this.

EDIT

I was turned around on what I was doing - true issue is - #5240 (comment)

@swills1 swills1 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 27, 2022
@branchvincent
Copy link
Member

I believe you're looking for the poetry show command

@swills1 swills1 changed the title poetry --show gives clickit "NoSuchOptionException(name)" error poetry show gives clickit "NoSuchOptionException(name)" error Feb 27, 2022
@swills1
Copy link
Author

swills1 commented Feb 27, 2022

I apologize, I wasn't thinking when I posted.. I do get an error with poetry show, I completely typed up the wrong thing. Basically I got this earlier today, came back and wasn't thinking and did --show and got a different error and posted all of that without thinking.. The true issue I have is the following;

  1. poetry new package
  2. cd package
  3. poetry shell
  4. poetry show
SolverProblemError

  Because test depends on pytest (^5.2) which doesn't match any versions, version solving failed.

  at ~/.local/lib/python3.10/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

@branchvincent
Copy link
Member

branchvincent commented Feb 27, 2022

Ah, no worries. Indeed, I can reproduce. Thanks for the report!

It seems this bug is triggered by a missing poetry.lock file, which show implicitly uses to display your dependencies. I'll try to spend time on a fix later. A temporary workaround would be to call lock before show (or any other command that creates the lockfile, such as install)

@branchvincent branchvincent self-assigned this Feb 27, 2022
@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
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
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants