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

incorrect exit status when package cannot be uninstalled #5073

Open
benoit-pierre opened this issue Mar 17, 2018 · 11 comments · May be fixed by #11520
Open

incorrect exit status when package cannot be uninstalled #5073

benoit-pierre opened this issue Mar 17, 2018 · 11 comments · May be fixed by #11520
Labels
good first issue A good item for first time contributors to work on type: bug A confirmed bug or unintended behavior

Comments

@benoit-pierre
Copy link
Member

  • Pip version: 9.0.1 / 9.0.1-744-gcb696fce
  • Python version: 3.6.4
  • Operating system: Arch Linux

Description:

Add a package' source directory to PYTHONPATH, and try to uninstall it with pip, e.g.:

> git clone -q --depth 1 https://github.com/python-xlib/python-xlib.git
> (cd python-xlib && python setup.py -q egg_info)
> PYTHONPATH=python-xlib pip uninstall python-xlib; echo $?
Can't uninstall 'python-xlib'. No files were found to uninstall.
0
@drunkwcodes
Copy link

Duplicate issue: #4737

@pfmoore
Copy link
Member

pfmoore commented Mar 27, 2018

#4737 is specifically about pip install with no arguments, although it expanded into discussion of the general case of what the exit code should be in various cases.

I'm not sure there's anything actionable from general discussions of principles. We'd be happy to consider PRs offering specific fixes - or indeed specific bug reports for individual cases such as this one.

In this case, the description is about uninstall whereas the title is about install. @benoit-pierre can I assume it's the title that's wrong? I'm happy for this to remain open as a separate issue (and indeed to look at a PR fixing it if anyone wants to provide one ;-))

@benoit-pierre benoit-pierre changed the title incorrect exit status when package cannot be installed incorrect exit status when package cannot be uninstalled Mar 27, 2018
@benoit-pierre
Copy link
Member Author

Yes, uninstall!

@pradyunsg pradyunsg added the type: bug A confirmed bug or unintended behavior label May 10, 2018
cmartinez131 added a commit to cmartinez131/pip that referenced this issue Jul 19, 2021
cmartinez131 added a commit to cmartinez131/pip that referenced this issue Jul 19, 2021
@pradyunsg pradyunsg added the good first issue A good item for first time contributors to work on label Oct 7, 2022
@pradyunsg
Copy link
Member

pradyunsg commented Oct 7, 2022

This issue is a good starting point for anyone who wants to help out with pip's development -- it's simple and the process of fixing this should be a good introduction to pip's development workflow. See the discussion above to understand what the desired fix is.

If there is not a corresponding pull request for this issue, it is up for grabs. For directions for getting set up, see our Getting Started Guide. If you are working on this issue and have questions, feel free to ask them here.

If you've already contributed to pip, work on another issue without this label instead.

@darshanip
Copy link

@pradyunsg, I'ld love to contribute for this fix.

@darshanip darshanip linked a pull request Oct 16, 2022 that will close this issue
@mahim37
Copy link

mahim37 commented Jan 8, 2023

Is this issue still relevant, I want to contribute @pradyunsg. If not, no worries.
Cheers!!

@darshanip
Copy link

darshanip commented Apr 25, 2023

Update: I've restarted working on this. #11520

@BenzhaminKim
Copy link

It's still open, so I'll start working on it.

@darshanip
Copy link

darshanip commented Nov 23, 2023

PR is created, but needs a review. @BenzhaminKim

@BenzhaminKim
Copy link

PR is created, but needs a review. @BenzhaminKim

CI test from your PR hasn't been passed yet. You need to fix it.

@BenzhaminKim
Copy link

#10176 (review)
@uranusjr Are you sure you want to return fail exit code when it fails to uninstall with only existing packages?

> git clone -q --depth 1 https://github.com/python-xlib/python-xlib.git
> (cd python-xlib && python setup.py -q egg_info)
> PYTHONPATH=python-xlib pip uninstall python-xlib; echo $?
Can't uninstall 'python-xlib'. No files were found to uninstall.
0

It gives No files were found logs. Then it seems correct exit code if you want to return success exit code when trying to uninstall not existing packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good item for first time contributors to work on type: bug A confirmed bug or unintended behavior
Projects
None yet
7 participants