Skip to content

Commit

Permalink
* use bookworm
Browse files Browse the repository at this point in the history
* use venv as Bookworm implemented PEP668
* explicitly install netcat-traditional package
  • Loading branch information
s-martin committed Oct 22, 2023
1 parent 0924bfe commit 6fa77cc
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_docker_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions components/gpio_control/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions components/rfid-reader/PN532/setup_pn532.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions components/rfid-reader/RC522/setup_rc522.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions scripts/RegisterDevice.py.Multi
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
13 changes: 11 additions & 2 deletions scripts/installscripts/buster-install-default-with-autohotspot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions scripts/installscripts/buster-install-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/installscripts/tests/test_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6fa77cc

Please sign in to comment.