Open itsayellow opened 3 years ago
Going further upstream, we could also make sure that we pass apps_of_dependencies through a set() to eliminate redundant entries. I'm curious if there are other thoughts on handling this annoying edge case properly.
It seems like whatever we do in this case we are in a pickle. If two apps have the same name, with what we must assume are not the same app content, then that should probably be a separate warning.
How about saying:
Detected multiple packages with the same name app "slugify". pipx is using the first app it encountered associated with package kaggle
and ignoring other apps with that name due to the name conflict.
We have a similar problem with colliding apps from different venvs (especially with --include-deps
). Currently if we install 2 venvs using --include-deps
with the same dependency apps, one will overwrite the other. Then if we uninstall one of these venvs, it will delete the dependency binary, even if the other package still exists.
Changing name since the original reason for the Issue has been fixed.
PR welcome.
Describe the bug
kaggle
contains two separate deps:slugify
andpython-slugify
. Each of these separate python packages contain an app with the nameslugify
.When pipx catalogs all of the
apps_of_dependencies
it listsslugify
twice in the list because it comes from separate dependencies.If pipx installs
kaggle
with switch--include-deps
it tries to write the slugify link twice, once from each dep. It gives the following warning during install:Then on uninstall, when going through the lists of
apps_of_dependencies
, it will encounterslugify
twice. The first time it removes the binary from the pipx bin directory, and the second time when it tries to remove a non-existent file, on Windows it throws a python error and sends the user a stack trace (see below).Solving the symptom is probably pretty easy: don't try and delete a non-existent file on Windows. macos and linux already have much more extensive checks whether the file exists in their symlink-centric part of the code.
Going further upstream, we could also make sure that we pass
apps_of_dependencies
through aset()
to eliminate redundant entries. I'm curious if there are other thoughts on handling this annoying edge case properly.How to reproduce
Expected behavior
No stacktrace.