-
-
Notifications
You must be signed in to change notification settings - Fork 508
Update pip install commands to use piwheels #588
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,14 +208,14 @@ setup_earlyoom_service() { | |
| create_venv(){ | ||
| echo "Creating python virtual environment. " | ||
| python3 -m venv "$VENV_PATH" | ||
| $VENV_PATH/bin/python -m pip install --upgrade pip setuptools wheel > /dev/null | ||
| $VENV_PATH/bin/python -m pip install -r $PIP_REQUIREMENTS_FILE -qq > /dev/null & | ||
| $VENV_PATH/bin/python -m pip install --extra-index-url https://www.piwheels.org/simple --upgrade pip setuptools wheel > /dev/null | ||
| $VENV_PATH/bin/python -m pip install --extra-index-url https://www.piwheels.org/simple -r $PIP_REQUIREMENTS_FILE -qq > /dev/null & | ||
|
Comment on lines
+211
to
+212
|
||
| show_loader "\tInstalling python dependencies. " | ||
|
|
||
| # do additional dependencies for Waveshare support. | ||
| if [[ -n "$WS_TYPE" ]]; then | ||
| echo "Adding additional dependencies for waveshare to the python virtual environment. " | ||
| $VENV_PATH/bin/python -m pip install -r $WS_REQUIREMENTS_FILE > ws_pip_install.log & | ||
| $VENV_PATH/bin/python -m pip install --extra-index-url https://www.piwheels.org/simple -r $WS_REQUIREMENTS_FILE > ws_pip_install.log & | ||
| show_loader "\tInstalling additional Waveshare python dependencies. " | ||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The piwheels repository is only available for ARMv6/ARMv7/ARMv8 architectures (Raspberry Pi). Using --extra-index-url makes pip fall back to PyPI if packages aren't found on piwheels, but this change will cause installation to fail on non-ARM architectures if the package exists on piwheels but is incompatible with the host architecture.
The install script doesn't detect the system architecture before adding the piwheels index. Consider adding an architecture check to conditionally include the piwheels URL only when running on ARM-based systems. For example, you could check if the output of 'uname -m' is 'armv6l', 'armv7l', or 'aarch64' before adding the --extra-index-url flag.