Skip to content

BUG: When poetry add failed, package is listed as added but is not installed. Also add proper handling for multiple packages install in "poetry add": when one package is already added, others are not getting added. #98

@buriy

Description

@buriy

If "poetry add" fails with an error on a package installation,
then after fixing the error it says "already added".
I need to remember to use "poetry install" then instead.

The same happens if you want to add more than one entry, and the first entry was already installed: it writes that the entry was already added, not doing anything.

And the third issue is that if one issue breaks, "poetry add" doesn't add anything and tries to run an install first!

Fourth, after a "poetry add" fail, I have to add the entry manually and then run "poetry install" which writes that "you probably updated your file, run poetry update for that".
That means that while "poetry add" can check for the project file updates, "poetry install" can't. That behavior feels wrong.

Suggestions:

  1. remove error "Package A is already present", and when trying to add an existing package, instead, show what is the current version of that package in the project file, like "Package A of version 2.3.1 is selected". Or, maybe, even better it is to replace the already added version instead of displaying current version.
  2. on "poetry add", first add everything to the project file, only then run install
  3. probably, poetry install should be consistent with poetry add, or maybe "poetry add" without arguments should work like "poetry update".

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/error-handlingBad error messages/insufficient error handling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions