Skip to content

Commit

Permalink
fix(cdk): place Python component binary in component root
Browse files Browse the repository at this point in the history
Modify pyinstaller build scaffolding to place the python component executable in the component root dir rather than a subdir

Signed-off-by: Timothy MacDonald <tim.macdonald@lacework.net>
  • Loading branch information
tmac1973 committed Oct 18, 2023
1 parent 2ccd309 commit 3c221a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cli/cmd/component_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,24 @@ func cdkPythonScaffolding(component *lwcomponent.Component) error {
return err
}

_, err = f.WriteString("build = \"poetry run pyinstaller src/")
_, err = f.WriteString("build.shell = \"poetry run pyinstaller src/")
if err != nil {
return err
}
_, err = f.WriteString(fmt.Sprintf(
"%s/__main__.py --collect-submodules application -D --name %s --distpath .\"\n",
"%s/__main__.py --collect-submodules application -D --name %s --distpath dist;",
component.Name, component.Name,
))
if err != nil {
return err
}
_, err = f.WriteString(fmt.Sprintf(
" mv dist/%s/* .\"\n",
component.Name,
))
if err != nil {
return err
}
_, err = f.WriteString(fmt.Sprintf(
"clean = \"rm -r build/ %s %s.spec\"\n",
component.Name, component.Name,
Expand Down

0 comments on commit 3c221a0

Please sign in to comment.