Skip to content
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

[Fix] if using venv, install PyQt inside it #157

Merged
merged 1 commit into from
Jul 5, 2024
Merged
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
17 changes: 15 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ if ! is_qt_installed; then
exit 1
fi

setup_virtual_environment() {
if [ -z "$NO_VENV" ] && [ ! -d "venv" ]; then
python3 -m venv venv
fi

if [ -n "$NO_VENV" ]; then
python3 -m pip install "$1"
else
source venv/bin/activate
python3 -m pip install "$1"
fi
}

# Function to install Python bindings based on Qt version
function install_python_bindings {
if is_qt_installed; then
Expand All @@ -133,7 +146,7 @@ function install_python_bindings {
elif [ "$PACKAGE_MANAGER" == "pacman" ]; then
sudo $PACKAGE_MANAGER -S --noconfirm python-pyqt6
fi
python3 -m pip install pyqt6
setup_virtual_environment pyqt6
fi
elif $PACKAGE_MANAGER -Qs '^qt5' >/dev/null 2>&1; then
if ! is_package_installed python3-pyqt5; then
Expand All @@ -144,7 +157,7 @@ function install_python_bindings {
elif [ "$PACKAGE_MANAGER" == "pacman" ]; then
sudo $PACKAGE_MANAGER -S --noconfirm python-pyqt5
fi
python3 -m pip install pyqt5
setup_virtual_environment pyqt5
fi
fi
fi
Expand Down