Commands in the release
module always return exit code 0, even if they fail
#1358
Labels
bug
Something isn't working
Hi,
When executing commands such as
nbdev_pypi
from a shell (which get routed tonbdev.release:release_pypi
), the commands always return exit code 0 regardless of the errors happening inside the command.I ran into this issue while using
nbdev_pypi
inside my CI/CD. If I forget to bump the version, for example, thetwine upload
command will fail with a "409 Conflict" error, but thenbdev_pypi
command still returns error code 0 (success).This is problematic, because there is no way to catch this error and do something useful (like fail the CI/CD build).
The code for
release_pypi
uses os.system calls like:https://github.com/fastai/nbdev/blob/4af4d479c78880f4a18af4254b119f8af8b3a8a4/nbdev/release.py#L307-L313C68
As far as I can see, the call to
os.system()
returns the exit code as a 0/1 but does not throw an exception.I'm happy to contribute a pull request to fix this, but would like some guidance on what is the right way to go about it.
Options I see:
Thanks!
Julian.
The text was updated successfully, but these errors were encountered: