8000 Store the PIP cache in a specific directory - #1149 by akuker · Pull Request #1153 · PiSCSI/piscsi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Store the PIP cache in a specific directory - #1149 #1153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions easyinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,18 @@ function installPackagesWeb() {

# cache the pip packages
function cachePipPackages(){
pushd $WEB_INSTALL_PATH
sudo pip3 install -r ./requirements.txt
popd
CACHEDIR="$HOME/.cache/piscsi"
mkdir -p "$CACHEDIR" || exit 1
# Note: these need to be installed in source form ONLY. If the binary packages are installed, the architecture
# is selected based upon the building host architecture, not the target architecture. (so, if you're building
# a PiSCSI image on x86, pip will download x86 binaries, which aren't usefull on a Raspberry Pi
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" set 8000 uptools
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" wheel
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" flit_core
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" -r $WEB_INSTALL_PATH/requirements.txt
python3 -m pip download --no-binary :all: --destination-directory "$CACHEDIR" -r $CTRLBOARD_INSTALL_PATH/requirements.txt
# TODO: The OLED requirements.txt includes a circuit python package that doesn't work with non-binary
# pip3 download
}

# compile the PiSCSI binaries
Expand Down
9 changes: 6 additions & 3 deletions python/web/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
set -e
# set -x # Uncomment to Debug

CACHEDIR="$HOME/.cache/piscsi"

cd "$(dirname "$0")"
# verify packages installed
ERROR=0
Expand Down Expand Up @@ -59,8 +61,9 @@ if ! test -e venv; then
echo "Activating venv"
source venv/bin/activate
echo "Installing requirements.txt"
pip3 install wheel
pip3 install -r requirements.txt
pip3 install wheel --no-index --find-links="$CACHEDIR"
# Reference: https://pip.pypa.io/en/latest/user_guide/#installing-from-local-packages
pip3 install -r requirements.txt --no-index --find-links="$CACHEDIR"

if git rev-parse --is-inside-work-tree &> /dev/null; then
git rev-parse HEAD > current
Expand All @@ -79,7 +82,7 @@ if [[ $? -eq 0 ]]; then
git rev-parse > current
elif [ "$(cat current)" != "$(git rev-parse HEAD)" ]; then
echo "New version detected, updating libraries from requirements.txt"
pip3 install -r requirements.txt
pip3 install -r requirements.txt --no-index --find-links="$CACHEDIR"
git rev-parse HEAD > current
fi
else
Expand Down
0