wimglenn / johnnydep

Display dependency tree of Python distribution
MIT License
501 stars 27 forks source link

`poetry remove johnnydep` removes dependent packages #101

Closed dblum-analog closed 1 year ago

dblum-analog commented 1 year ago

Question - I'm having an issue with Poetry and johnnydep which I can't recreate with other packages (hence posting here and not on Poetry's repo page).

When I poetry remove johnnydep, it also removes packages poetry is dependent on:

(mldpd-base) ubuntu@1ce5a5515f8a:~/mldpd-base$ poetry remove johnnydep
Skipping virtualenv creation, as specified in config file.
Updating dependencies
Resolving dependencies... (1.6s)

Writing lock file

Package operations: 0 installs, 0 updates, 9 removals

  • Removing anytree (2.8.0)
  • Removing cachetools (5.2.0)
  • Removing johnnydep (1.16)
  • Removing oyaml (1.0)
  • Removing pkginfo (1.9.2)
  • Removing structlog (22.3.0)
  • Removing tabulate (0.9.0)
  • Removing wheel (0.38.4)
  • Removing wimpy (0.6)

Then, poetry doesn't like life:

(mldpd-base) ubuntu@1ce5a5515f8a:~/mldpd-base$ poetry show
Skipping virtualenv creation, as specified in config file.

No module named 'pkginfo'
(mldpd-base) ubuntu@1ce5a5515f8a:~/mldpd-base$

This might be related to me not using poetry's virtual environments, but again, I can't recreate this with any other package.

If anyone has any thoughts, please let me know!

wimglenn commented 1 year ago

We have nothing to do with how poetry remove command works (or doesn't..), so this looks more like a bug in poetry than in johnnydep. The only thing I can advise you is that johnnydep and poetry both share a common dependency on pkginfo, so if you have both projects installed in the same venv, then there is a shared dependency here. Normally, poetry would be installed to its own isolated venv, rather than directly in the venv of the development environment.

I'm going to close this, but please recreate your issue over there.