diff --git a/.github/workflows/test_docker_debian.yml b/.github/workflows/test_docker_debian.yml index ab0b9ec8a..acb385cf0 100644 --- a/.github/workflows/test_docker_debian.yml +++ b/.github/workflows/test_docker_debian.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - debian_version_name: ['bullseye', 'buster'] + debian_version_name: ['bullseye', 'buster', 'bookworm'] uses: ./.github/workflows/test_docker_debian_versionname_sub.yml with: runs_on: ubuntu-latest diff --git a/components/gpio_control/install.sh b/components/gpio_control/install.sh index 7925ce44a..1cc82172d 100755 --- a/components/gpio_control/install.sh +++ b/components/gpio_control/install.sh @@ -16,6 +16,9 @@ systemctl stop phoniebox-gpio-buttons.service systemctl disable phoniebox-gpio-buttons.service echo 'Install all required python modules' +# Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 +python3 -m venv .venv +source .venv/bin/activate python3 -m pip install --upgrade --force-reinstall -r requirements.txt echo diff --git a/components/rfid-reader/PN532/setup_pn532.sh b/components/rfid-reader/PN532/setup_pn532.sh index 3b9ab1252..9838e6f33 100755 --- a/components/rfid-reader/PN532/setup_pn532.sh +++ b/components/rfid-reader/PN532/setup_pn532.sh @@ -33,6 +33,9 @@ else fi printf "Installing Python requirements for PN532...\n" +# Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 +sudo python3 -m venv .venv +sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${JUKEBOX_HOME_DIR}"/components/rfid-reader/PN532/requirements.txt printf "Configure RFID reader in Phoniebox...\n" diff --git a/components/rfid-reader/RC522/setup_rc522.sh b/components/rfid-reader/RC522/setup_rc522.sh index ece9a9144..cede2beb9 100644 --- a/components/rfid-reader/RC522/setup_rc522.sh +++ b/components/rfid-reader/RC522/setup_rc522.sh @@ -17,6 +17,9 @@ printf "Please make sure that the RC522 reader is wired up correctly to the GPIO question "Continue" printf "Installing Python requirements for RC522...\n" +# Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 +sudo python3 -m venv .venv +sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${JUKEBOX_HOME_DIR}"/components/rfid-reader/RC522/requirements.txt printf "Activating SPI...\n" diff --git a/scripts/RegisterDevice.py.Multi b/scripts/RegisterDevice.py.Multi index 66dc16898..3994da270 100644 --- a/scripts/RegisterDevice.py.Multi +++ b/scripts/RegisterDevice.py.Multi @@ -32,6 +32,9 @@ def setupPN532(): print(str(output)) return False print("Installing Python requirements for PN532...\n") + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + runCmd("sudo python3 -m venv .venv") + runCmd("sudo source .venv/bin/activate") runCmd("sudo python3 -m pip install --upgrade --force-reinstall " "-q -r {}/components/rfid-reader/PN532/requirements.txt".format(JUKEBOX_HOME_DIR)) print("Done") @@ -44,6 +47,9 @@ def setupMFRC522(): if not answer or answer[0] != 'Y': return False print("Installing Python requirements for RC522...\n") + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + runCmd("sudo python3 -m venv .venv") + runCmd("sudo source .venv/bin/activate") runCmd("sudo python3 -m pip install --upgrade --force-reinstall " "-q -r {}/components/rfid-reader/RC522/requirements.txt".format(JUKEBOX_HOME_DIR)) print("Done") diff --git a/scripts/installscripts/buster-install-default-with-autohotspot.sh b/scripts/installscripts/buster-install-default-with-autohotspot.sh index 948b3ebbe..900fe4d5d 100644 --- a/scripts/installscripts/buster-install-default-with-autohotspot.sh +++ b/scripts/installscripts/buster-install-default-with-autohotspot.sh @@ -824,7 +824,7 @@ install_main() { ${apt_get} ${allow_downgrades} install raspberrypi-kernel-headers fi - ${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php-common php-cgi php at mpd mpc mpg123 git ffmpeg resolvconf spi-tools netcat alsa-utils lsof procps + ${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php-common php-cgi php at mpd mpc mpg123 git ffmpeg resolvconf spi-tools netcat-traditional alsa-utils lsof procps # in the docker test env fiddling with resolv.conf causes issues, see https://stackoverflow.com/a/60576223 if [ "$DOCKER_RUNNING" != "true" ]; then @@ -833,7 +833,7 @@ install_main() { fi # prepare python3 - ${apt_get} ${allow_downgrades} install python3 python3-dev python3-pip python3-setuptools python3-wheel python3-mutagen python3-gpiozero python3-spidev + ${apt_get} ${allow_downgrades} install python3 python3-dev python3-pip python3-setuptools python3-wheel python3-mutagen python3-gpiozero python3-spidev python3-venv # use python3.7 as default sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1 @@ -871,11 +871,17 @@ install_main() { ${apt_get} ${allow_downgrades} install libspotify12 python3-cffi python3-ply python3-pycparser python3-spotify # Install necessary Python packages + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + sudo python3 -m venv .venv + sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements-spotify.txt fi # Install more required packages echo "Installing additional Python packages..." + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + sudo python3 -m venv .venv + sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements.txt samba_config @@ -1010,6 +1016,9 @@ install_main() { # GPIO-Control if [[ "${GPIOconfig}" == "YES" ]]; then + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + sudo python3 -m venv .venv + sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements-GPIO.txt sudo systemctl enable phoniebox-gpio-control.service if [[ ! -f "${jukebox_dir}"/settings/gpio_settings.ini ]]; then diff --git a/scripts/installscripts/buster-install-default.sh b/scripts/installscripts/buster-install-default.sh index b5c9108bc..ae88c4be3 100644 --- a/scripts/installscripts/buster-install-default.sh +++ b/scripts/installscripts/buster-install-default.sh @@ -824,7 +824,7 @@ install_main() { ${apt_get} ${allow_downgrades} install raspberrypi-kernel-headers fi - ${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php-common php-cgi php at mpd mpc mpg123 git ffmpeg resolvconf spi-tools netcat alsa-utils lsof procps + ${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php-common php-cgi php at mpd mpc mpg123 git ffmpeg resolvconf spi-tools netcat-traditional alsa-utils lsof procps # in the docker test env fiddling with resolv.conf causes issues, see https://stackoverflow.com/a/60576223 if [ "$DOCKER_RUNNING" != "true" ]; then @@ -833,7 +833,7 @@ install_main() { fi # prepare python3 - ${apt_get} ${allow_downgrades} install python3 python3-dev python3-pip python3-setuptools python3-wheel python3-mutagen python3-gpiozero python3-spidev + ${apt_get} ${allow_downgrades} install python3 python3-dev python3-pip python3-setuptools python3-wheel python3-mutagen python3-gpiozero python3-spidev python3-venv # use python3 as default sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 @@ -872,11 +872,17 @@ install_main() { ${apt_get} ${allow_downgrades} install libspotify12 python3-cffi python3-ply python3-pycparser python3-spotify # Install necessary Python packages + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + sudo python3 -m venv .venv + sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements-spotify.txt fi # Install more required packages echo "Installing additional Python packages..." + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + sudo python3 -m venv .venv + sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements.txt samba_config @@ -1011,6 +1017,9 @@ install_main() { # GPIO-Control if [[ "${GPIOconfig}" == "YES" ]]; then + # Use a venv as Bookworm implemented PEP668 https://stackoverflow.com/a/75696359 + sudo python3 -m venv .venv + sudo source .venv/bin/activate sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements-GPIO.txt sudo systemctl enable phoniebox-gpio-control.service if [[ ! -f "${jukebox_dir}"/settings/gpio_settings.ini ]]; then diff --git a/scripts/installscripts/tests/test_installation.sh b/scripts/installscripts/tests/test_installation.sh index 332cfb8cb..82b4d03ce 100755 --- a/scripts/installscripts/tests/test_installation.sh +++ b/scripts/installscripts/tests/test_installation.sh @@ -172,7 +172,7 @@ verify_apt_packages(){ local packages="samba samba-common-bin gcc lighttpd php${phpver}-common php${phpver}-cgi php${phpver} at mpd mpc mpg123 git ffmpeg resolvconf spi-tools python3 python3-dev python3-pip python3-setuptools python3-wheel python3-mutagen python3-gpiozero -python3-spidev netcat alsa-utils" +python3-spidev python3-venv netcat-traditional alsa-utils" local packages_raspberrypi="raspberrypi-kernel-headers" local packages_spotify="libspotify-dev mopidy mopidy-mpd mopidy-local mopidy-spotify libspotify12 python3-cffi python3-ply python3-pycparser python3-spotify"