Skip to content

Commit ec2a242

Browse files
committed
Add Bash build script
1 parent 1a1c38a commit ec2a242

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

source-code/pyinstaller/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ interpreter or any modules. It is very useful to minimize dependencies.
1313
1. `data.csv`: CSV file that is used by the Python script in `src`.
1414
1. `requirements.txt`: file listing the Python packages that are required by
1515
the Python script in `src`.
16+
1. `build_apps.sh`: Bash script that creates a virtual environment, installs
17+
the required packages, and creates a standalone application using
18+
PyInstaller.
1619

1720

1821
## How to create the applications?
@@ -32,8 +35,8 @@ interpreter or any modules. It is very useful to minimize dependencies.
3235
src/sum_columns.py
3336
(venv)$ pyinstaller \
3437
--onefile \
35-
--add-data data.csv:data.csv \
38+
--add-data data.csv:. \
3639
--hidden-import funcs \
3740
--collect-submodules funcs \
38-
src/sum_columns.py
41+
src/prod_columns.py
3942
```

source-code/pyinstaller/build_apps.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
# create a virtual environment and install the dependencies
4+
python -m venv build_venv
5+
source build_venv/bin/activate
6+
pip install -r requirements.txt
7+
8+
# build the apps
9+
pyinstaller \
10+
--onefile \
11+
--hidden-import funcs \
12+
--collect-submodules funcs \
13+
src/sum_columns.py
14+
pyinstaller \
15+
--onefile \
16+
--add-data data.csv:. \
17+
--hidden-import funcs \
18+
--collect-submodules funcs \
19+
src/prod_columns.py

0 commit comments

Comments
 (0)