Skip to content

Commit

Permalink
Ensure pip is installed in the Python virtual environment, bump minor…
Browse files Browse the repository at this point in the history
… release, update release notes
  • Loading branch information
ron.record committed May 8, 2024
1 parent 4cd39ac commit 408f50c
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION=2.1.0
RELEASE=4
RELEASE=5
14 changes: 13 additions & 1 deletion etc/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
22 changes: 14 additions & 8 deletions linInstall
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion macInstall
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 5 additions & 3 deletions pkg/release.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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 <https://github.com/doctorfree/RoonCommandLine/blob/v2.1.0r4/CHANGELOG.md>
View the full changelog for this release at <https://github.com/doctorfree/RoonCommandLine/blob/v2.1.0r5/CHANGELOG.md>

See [CHANGELOG.md](https://github.com/doctorfree/RoonCommandLine/blob/master/CHANGELOG.md) for a full list of changes in every RoonCommandLine release

0 comments on commit 408f50c

Please sign in to comment.