This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: All pysetup commands should respect exit codes
Type: Stage: resolved
Components: Distutils2 Versions: Python 3.3
Status: closed Resolution: fixed
Dependencies: 11409 Superseder:
Assigned To: tarek Nosy List: alexis, eric.araujo, python-dev, tarek
Priority: high Keywords: patch

Created on 2011-05-31 09:16 by tarek, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
p7g-run-cleanup.diff eric.araujo, 2011-06-10 16:10 review
Messages (7)
msg137348 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2011-05-31 09:16
All actions in need to respect a basic exit convention 0/1. 

This is important because pysetup will be used in automated scripts so the caller needs to know wether the call failed or succedeed. 

Example: pysetup install project => sys,exit(0 or 1)
msg137355 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2011-05-31 10:21
fixed install in
msg138097 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-10 16:10
Here’s a patch adding “return 1” after all errors, unifying the use of logging and cleaning up a few things (like moving KeyboardInterrupt handling from the _run function up to the main function).
msg138098 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-10 16:11
BTW, some functions do not explicitly return 0, but this is okay: they will return None, which is a boolean false value, which is understood as 0 by sys.exit.
msg141351 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-07-29 12:35
New changeset 998566bf7fba by Éric Araujo in branch 'default':
Let all pysetup actions return a meaningful 0 or 1 exit code (#12222).
msg141378 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-29 13:47
I committed my patch, except for one change in the run action.  It returns the dist.Distribution instance, which is needed by test_uninstall and not trivial to fix.  I tried changing the code to use Distribution and command objects directly but suddenly the --prefix option was not respected, so I stopped after a few tries.
msg144996 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-06 11:24
New changeset ab125793243f by Éric Araujo in branch 'default':
Fix return code of “pysetup run COMMAND” (closes #12222)
Date User Action Args
2022-04-11 14:57:18adminsetgithub: 56431
2011-10-06 11:24:05python-devsetstatus: open -> closed
resolution: fixed
messages: + msg144996

stage: resolved
2011-07-29 13:47:44eric.araujosetmessages: + msg141378
2011-07-29 12:35:19python-devsetnosy: + python-dev
messages: + msg141351
2011-06-10 16:11:46eric.araujosetmessages: + msg138098
2011-06-10 16:10:38eric.araujosetfiles: + p7g-run-cleanup.diff
keywords: + patch
messages: + msg138097
2011-06-06 16:13:10eric.araujosetdependencies: + pysetup --search should return non-zero when a dist is not installed and print a message stating the fact.
2011-05-31 10:21:50tareksetmessages: + msg137355
2011-05-31 09:16:12tarekcreate