Skip to content

Commit

Permalink
Fix pyinstaller packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
lsibilla committed Dec 13, 2020
1 parent ec99510 commit 42e8413
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN coverage run --source ./runci --timid -m unittest && coverage report -m
RUN pip install .

COPY runci.spec /src/runci.spec
COPY hook-*.py /src/
RUN pyinstaller runci.spec


Expand Down
4 changes: 4 additions & 0 deletions hook-runci.engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from runci.engine.core import default_modules


hiddenimports = default_modules
4 changes: 2 additions & 2 deletions runci.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ a = Analysis(['main.py'],
pathex=['./runci'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hiddenimports=['runci.engine'],
hookspath=['.'],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
Expand Down
10 changes: 5 additions & 5 deletions runci/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ def main(targets, file):
unknown_targets = [t for t in targets if t not in [t.name for t in project.targets]]
if any(unknown_targets):
print("Unkown targets: %s" % str.join(" ", unknown_targets), file=sys.stderr)
exit(1)
sys.exit(1)

result = asyncio.run(run_project(context))

if result == JobStatus.SUCCEEDED:
print("Pipeline has run succesfully.")
exit(0)
sys.exit(0)
elif result == JobStatus.FAILED:
print("Pipeline has failed.", file=sys.stderr)
exit(1)
sys.exit(1)
elif result == JobStatus.CANCELED:
print("Pipeline has been canceled.", file=sys.stderr)
exit(2)
sys.exit(2)
else:
print("Pipeline has been run but outcome is undetermined. Please report this as a bug.", file=sys.stderr)
exit(3)
sys.exit(3)


async def run_project(context):
Expand Down

0 comments on commit 42e8413

Please sign in to comment.