Skip to content

Commit

Permalink
Use other exit code on error (#2)
Browse files Browse the repository at this point in the history
* Use other exit code on error

* Fix lint
  • Loading branch information
pvizeli authored May 2, 2019
1 parent 9eba99c commit 5bc99cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion builder/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path
from tempfile import TemporaryDirectory
from subprocess import CalledProcessError
import sys

import click
import click_pathlib
Expand Down Expand Up @@ -29,6 +30,7 @@ def builder(apk, index, requirement, upload, remote):
install_apks(apk)
check_url(index)

exit_code = 0
with TemporaryDirectory() as temp_dir:
output = Path(temp_dir)

Expand All @@ -38,10 +40,12 @@ def builder(apk, index, requirement, upload, remote):
try:
build_wheels(requirement, wheels_index, wheels_dir)
except CalledProcessError:
pass
exit_code = 109

run_upload(upload, output, remote)

sys.exit(exit_code)


if __name__ == "__main__":
builder() # pylint: disable=no-value-for-parameter
2 changes: 1 addition & 1 deletion builder/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def build_wheels(requirement: Path, index: str, output: Path) -> None:
build_env['MAKEFLAGS'] = f"-j{cpu}"

result = subprocess.run(
f"pip3 wheel --wheel-dir {output} --find-links {index} --requirement {requirement}",
f"pip3 wheel --progress-bar ascii --wheel-dir {output} --find-links {index} --requirement {requirement}",
shell=True, stdout=sys.stdout, stderr=sys.stderr, env=build_env
)

Expand Down

0 comments on commit 5bc99cc

Please sign in to comment.