From 408f50cbaf3846a4ad639f003e08ce8166528044 Mon Sep 17 00:00:00 2001 From: "ron.record" Date: Wed, 8 May 2024 12:22:28 -0700 Subject: [PATCH] Ensure pip is installed in the Python virtual environment, bump minor release, update release notes --- CHANGELOG.md | 7 +++++++ VERSION | 2 +- etc/postinstall | 14 +++++++++++++- linInstall | 22 ++++++++++++++-------- macInstall | 12 +++++++++++- pkg/release.md | 8 +++++--- 6 files changed, 51 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71a6d39..2a82140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +May 08, 2024 : +RoonCommandLine version 2.1.0 release 5 + + This release ensures that pip is installed in the Python virtual environment: + * Activate the Python virtual environment in all install scripts + * Use the built-in ensurepip Python module to ensure pip is installed + Feb 20, 2024 : RoonCommandLine version 2.1.0 release 4 diff --git a/VERSION b/VERSION index b0d9dc1..2b77248 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ VERSION=2.1.0 -RELEASE=4 +RELEASE=5 diff --git a/etc/postinstall b/etc/postinstall index 5163190..3ccd3d3 100755 --- a/etc/postinstall +++ b/etc/postinstall @@ -26,8 +26,20 @@ else fi [ -d ${ROON} ] || mkdir -p ${ROON} +# Create the RoonCommandLine Python virtual environment ${PYTHON} -m venv ${ROON}/venv >/dev/null 2>&1 +# Use the RoonCommandLine Python virtual environment +[ -f ${ROON}/venv/bin/activate ] && source ${ROON}/venv/bin/activate +[[ ":$PATH:" == *":/usr/local/Roon/venv/bin:"* ]] || { + export PATH=/usr/local/Roon/venv/bin:${PATH} +} [ -x ${ROON}/venv/bin/python ] && export PYTHON=${ROON}/venv/bin/python +# Make sure we have pip installed +${PYTHON} -m ensurepip --upgrade >/dev/null 2>&1 +[ -x ${ROON}/venv/bin/pip ] || { + ${PYTHON} -m pip install --upgrade pip >/dev/null 2>&1 +} + ${PYTHON} -m pip install ${PIPARGS} roonapi >/dev/null 2>&1 ${PYTHON} -m pip install ${PIPARGS} rich-cli >/dev/null 2>&1 @@ -55,7 +67,7 @@ if [ -f "${ROON_DOC}/VERSION" ]; then else # Should not happen but if it did we fake it version="2.1.0" - release="4" + release="5" fi # Copy in distributed roon_api.ini template if no previous one exists diff --git a/linInstall b/linInstall index c6ca3d2..db9e77d 100755 --- a/linInstall +++ b/linInstall @@ -75,15 +75,21 @@ done [ -d ${DESTDIR}/share/doc ] || ${SUDO} mkdir ${DESTDIR}/share/doc [ -d ${DESTDIR}/share/doc/${PKG} ] || ${SUDO} mkdir ${DESTDIR}/share/doc/${PKG} -# Install the Python Roon API -# if pip list | grep roonapi >/dev/null; then -# ${SUDO} ${PYTHON} -m pip install --upgrade roonapi >/dev/null 2>&1 -# else -# ${SUDO} ${PYTHON} -m pip install roonapi >/dev/null 2>&1 -# fi -# ${SUDO} ${PYTHON} -m pip install rich-cli >/dev/null 2>&1 -${SUDO} ${PYTHON} -m venv ${ROON}/venv +# Create the RoonCommandLine Python virtual environment +${SUDO} ${PYTHON} -m venv ${ROON}/venv >/dev/null 2>&1 +# Use the RoonCommandLine Python virtual environment +[ -f ${ROON}/venv/bin/activate ] && source ${ROON}/venv/bin/activate +[[ ":$PATH:" == *":/usr/local/Roon/venv/bin:"* ]] || { + export PATH=/usr/local/Roon/venv/bin:${PATH} +} [ -x ${ROON}/venv/bin/python ] && export PYTHON=${ROON}/venv/bin/python +# Make sure we have pip installed +${SUDO} ${PYTHON} -m ensurepip --upgrade >/dev/null 2>&1 +[ -x ${ROON}/venv/bin/pip ] || { + ${SUDO} ${PYTHON} -m pip install --upgrade pip >/dev/null 2>&1 +} + +# Install the Python Roon API ${SUDO} ${PYTHON} -m pip install roonapi ${SUDO} ${PYTHON} -m pip install rich-cli diff --git a/macInstall b/macInstall index 08829e1..4c6748f 100755 --- a/macInstall +++ b/macInstall @@ -38,9 +38,19 @@ fi } [ -d ${ROON} ] || ${SUDO} mkdir -p ${ROON} -${SUDO} ${PYTHON} -m venv ${ROON}/venv +# Create the RoonCommandLine Python virtual environment +${SUDO} ${PYTHON} -m venv ${ROON}/venv >/dev/null 2>&1 +# Use the RoonCommandLine Python virtual environment +[ -f ${ROON}/venv/bin/activate ] && source ${ROON}/venv/bin/activate +[[ ":$PATH:" == *":/usr/local/Roon/venv/bin:"* ]] || { + export PATH=/usr/local/Roon/venv/bin:${PATH} +} [ -x ${ROON}/venv/bin/python ] && export PYTHON=${ROON}/venv/bin/python +# Make sure we have pip installed ${SUDO} ${PYTHON} -m ensurepip --upgrade >/dev/null 2>&1 +[ -x ${ROON}/venv/bin/pip ] || { + ${SUDO} ${PYTHON} -m pip install --upgrade pip >/dev/null 2>&1 +} SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) diff --git a/pkg/release.md b/pkg/release.md index 1d37942..37acdd8 100644 --- a/pkg/release.md +++ b/pkg/release.md @@ -1,5 +1,7 @@ # RoonCommandLine Release Notes +RoonCommandLine version 2.1.0 release 5 ensures that pip is installed in the Python virtual environment + RoonCommandLine version 2.1.0 release 4 adds the capability to transfer the current queue from one Roon zone to another RoonCommandLine version 2.1.0 release 3 moves to a Python virtual environment to support Ubuntu 23.04, Debian 12, and later @@ -25,13 +27,13 @@ The installation automatically detects and stores the Roon Core IP and port. The Install the package on Debian based systems by executing the command ```bash -sudo apt install ./RoonCommandLine_2.1.0-4.deb +sudo apt install ./RoonCommandLine_2.1.0-5.deb ``` Install the package on RPM based systems by executing the command ```bash -sudo yum localinstall ./RoonCommandLine-2.1.0-4.rpm +sudo yum localinstall ./RoonCommandLine-2.1.0-5.rpm ``` Removal of the package on Debian based systems can be accomplished by issuing the command: @@ -91,6 +93,6 @@ Version 2.0.7 release 1 added support for: - Add `get_zone_remaining` to get remaining time for now playing in zone - Add `get_zone_volume` and `get_zone_attributes.py` -View the full changelog for this release at +View the full changelog for this release at See [CHANGELOG.md](https://github.com/doctorfree/RoonCommandLine/blob/master/CHANGELOG.md) for a full list of changes in every RoonCommandLine release