-
Notifications
You must be signed in to change notification settings - Fork 572
chore: add try/catch in release script #479
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
Conversation
try: | ||
call_bash_script('twine upload "{}"'.format(push_file)) | ||
except Exception as e: | ||
print('Failed to upload {} to pypi. ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the error be printed to stderr?
should we rethrow the exception after print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was enough to print messages as stdout without stop/rethrow errors.
Current usage is showing messages on CLI and should not stop this by this error.
release.sh
Outdated
|
||
CONFIGURE_DIR=$(dirname "$0") | ||
"$PYTHON_BIN_PATH" "${CONFIGURE_DIR}/script/release.py" "$@" | ||
"$PYTHON_BIN_PATH" -m "${CONFIGURE_DIR}/script/release.py" "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding, -m
has no meaning.
Module name needs to follow after -m
. (e.g. pip, pytest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. yeah, it's true
Just question
In this case, doesn't this script exit during |
No, that was passed. I also expected the command stopped by it. |
If the python environment has no
twine
, an exception will occur. The command only pushes the dist module to pypi. (Building the module is in another method)It can run after other tasks, so let me show a message to push later when the command fails.