Why poetry removes some entries after running 'add'?

Viewed 230

I've a poetry-managed project. When I run:

poetry add isort@5.10.1 --dev

I'm getting this dependency added to the project, however some other dependencies are automatically removed, namely:

  • importlib-metadata
  • typed-ast
  • zipp (dependency of importlib-metadata)

None of the removed dependencies was listed in pyproject.toml.

What is the reason for that? importlib seems to be a python builtin. Is it safe to commit such change? How can I determine potential problems?

1 Answers

When you update one or more dependencies, it could and will happen that some dependencies of those dependencies are not necessary anymore. Poetry will detect this and remove unused transient dependencies for you.

Related