-
Notifications
You must be signed in to change notification settings - Fork 18
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
regression: all commands return exit code 1 #18
Comments
If fact, exit code is not handled: the return value of Why it returns always 1? Because of the definition of the entry point (see __requires__ = 'repositorytools'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('repositorytools', 'console_scripts', 'artifact')()
) The script calls If it returns an integer, you'll get this exit code (module 128 and a sign). $ python -c "import sys; sys.exit(0);"
$ echo $?
0
$ python -c "import sys; sys.exit(12);"
$ echo $?
12 But if the return value is not an integer you'll always get 1 (and a message is displayed). $ python -c "import sys; sys.exit('bye.');"
bye.
$ echo $?
1 To make the entry points works, you need to return 0 in the def __call__(self, *args):
self.run(*args)
return 0 # exit code The documentation: https://docs.python.org/3/library/sys.html?highlight=sys.exit#sys.exit |
Amazing investigation. Can you please prepare a pull request? Nothing else than tests uses return codes from the run() method AFAIK. Don't forget to put yourself to AUTHORS file in root directory (and please add me there as well :) I'd like to release a bugfix version by end of this week. |
To list all the contributors: git log --format='%aN <%aE>' | awk '{arr[$0]++} END{for (i in arr){print arr[i], i;}}' | sort -rn | cut -d\ -f2- Source: http://www.commandlinefu.com/commands/view/4519/list-all-authors-of-a-particular-git-project |
What do you think of this kind of =======
Credits
=======
Development Lead
----------------
* Michel SAMIA <stardust1985@gmail.com>
Contributors
------------
* Laurent LAPORTE <tantale.solutions@gmail.com> |
Perfect, exactly what I was thinking of. Maybe that file isn't necessary (git log works well), but I wanted to use it to motivate people for contributions :) |
caused by #17
How to reproduce (unix):
echo foo > foo
artifact upload foo test com.example
echo $?
expected result:
upload succeeds
return code 0
current result:
upload succeeds
return code 1
The text was updated successfully, but these errors were encountered: