File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,17 @@ function installPackagesWeb() {
153
153
154
154
# cache the pip packages
155
155
function cachePipPackages(){
156
- pushd $WEB_INSTALL_PATH
157
- sudo pip3 install -r ./requirements.txt
158
- popd
156
+ mkdir -p $HOME /.pip_cache
157
+ # Note: these need to be installed in source form ONLY. If the binary packages are installed, the architecture
158
+ # is selected based upon the building host architecture, not the target architecture. (so, if you're building
159
+ # a PiSCSI image on x86, pip will download x86 binaries, which aren't usefull on a Raspberry Pi
160
+ python3 -m pip download --no-binary :all: --destination-directory $HOME /.pip_cache setuptools
161
+ python3 -m pip download --no-binary :all: --destination-directory $HOME /.pip_cache wheel
162
+ python3 -m pip download --no-binary :all: --destination-directory $HOME /.pip_cache flit_core
163
+ python3 -m pip download --no-binary :all: --destination-directory $HOME /.pip_cache -r $WEB_INSTALL_PATH /requirements.txt
164
+ python3 -m pip download --no-binary :all: --destination-directory $HOME /.pip_cache -r $CTRLBOARD_INSTALL_PATH /requirements.txt
165
+ # TODO: The OLED requirements.txt includes a circuit python package that doesn't work with non-binary
166
+ # pip3 download
159
167
}
160
168
161
169
# compile the PiSCSI binaries
Original file line number Diff line number Diff line change @@ -59,8 +59,9 @@ if ! test -e venv; then
59
59
echo " Activating venv"
60
60
source venv/bin/activate
61
61
echo " Installing requirements.txt"
62
- pip3 install wheel
63
- pip3 install -r requirements.txt
62
+ pip3 install wheel --no-index --find-links=$HOME /.pip_cache
63
+ # Reference: https://pip.pypa.io/en/latest/user_guide/#installing-from-local-packages
64
+ pip3 install -r requirements.txt --no-index --find-links=$HOME /.pip_cache
64
65
65
66
if git rev-parse --is-inside-work-tree & > /dev/null; then
66
67
git rev-parse HEAD > current
@@ -79,7 +80,7 @@ if [[ $? -eq 0 ]]; then
79
80
git rev-parse > current
80
81
elif [ " $( cat current) " != " $( git rev-parse HEAD) " ]; then
81
82
echo " New version detected, updating libraries from requirements.txt"
82
- pip3 install -r requirements.txt
83
+ pip3 install -r requirements.txt --no-index --find-links= $HOME /.pip_cache
83
84
git rev-parse HEAD > current
84
85
fi
85
86
else
You can’t perform that action at this time.
0 commit comments