Skip to content

Commit 1d6ef0d

Browse files
committed
now using virtual environment to install packages
1 parent 17e982b commit 1d6ef0d

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
./make.sh
1919
# deploy to github pages
2020
- name: deploy documentation
21-
uses: JamesIves/github-pages-deploy-action@a1ea191d508feb8485aceba848389d49f80ca2dc
21+
uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e
2222
with:
2323
branch: gh-pages
2424
folder: /home/runner/work/programmingWithPathon/programmingWithPathon/website/

make.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ echo "$(date +'%0Y-%0m-%0d %0R:%0S'): First we delete all left over data."
1919
rm "book.pdf" || true
2020
rm -rf "$currentDir/website" || true
2121

22-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Initialization: We install all required Python packages from requirements.txt."
22+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): First, we need to setup a virtual environment in a temp directory."
23+
tempDir="$(mktemp -d)"
24+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Got temp dir '$tempDir', now creating environment in it."
25+
python3 -m venv "$tempDir"
26+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Activating virtual environment in '$tempDir'."
27+
. "$tempDir/bin/activate"
28+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Initialization: We install all required Python packages from requirements.txt to virtual environment in '$tempDir'."
2329
pip install --no-input --timeout 360 --retries 100 -r requirements.txt
2430
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Finished installing the requirements, now printing all installed packages."
2531
pip freeze
@@ -28,9 +34,12 @@ echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Finished printing all installed packages."
2834
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We now execute the pdflatex compiler script."
2935
"$scriptDir/pdflatex.sh" "book.tex"
3036

37+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Deactivating virtual environment."
38+
deactivate
39+
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Deleting virtual environment."
40+
rm -rf "$tempDir"
41+
3142
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We now execute the website building script."
3243
"$scriptDir/website.sh"
3344

3445
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We have finished the book building process."
35-
36-

0 commit comments

Comments
 (0)