Skip to content

Commit

Permalink
[CI/CD] Add PyPi release workflow to dev branch (#2675)
Browse files Browse the repository at this point in the history
Apply beta "b1" version suffix for a pre-release on PyPI.

Bump version string to 0.43.1b1 for simpler upgrades from 0.43.0, which did not have a pre-release suffix.

Update install instructions to pull pre-release from PyPI instead of GitHub.

Additionally add instructions to work around the "error: externally-managed-environment" error on recent Debian and Ubuntu versions.

Signed-off-by: MichaIng <micha@dietpi.com>
  • Loading branch information
MichaIng committed Dec 24, 2023
1 parent 63a4493 commit 2862efe
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PyPI release

on: workflow_dispatch

permissions:
contents: read

jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade build twine
- name: Build package
run: python -m build
- name: Publish package
#run: twine upload -r testpypi -u '__token__' -p '${{ secrets.TEST_PYPI_API_TOKEN }}' dist/*
run: twine upload -r pypi -u '__token__' -p '${{ secrets.PYPI_TOKEN }}' dist/*
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ These install instructions are constantly tested via CI/CD pipeline on Debian Bu

_Here the commands for APT-based Linux distributions are given._

On **32-bit ARMv6 and ARMv7** systems:
On **32-bit ARMv6 and ARMv7** systems, thanks to [piwheels](https://piwheels.org/), no development headers are required:
```sh
sudo apt update
sudo apt --no-install-recommends install ca-certificates curl python3 python3-distutils
```

On all other architectures additional development headers are required:
On **all other architectures** additional development headers are required:
```sh
sudo apt update
sudo apt --no-install-recommends install ca-certificates curl python3 python3-dev libcurl4-openssl-dev gcc libssl-dev
Expand All @@ -38,14 +38,22 @@ These install instructions are constantly tested via CI/CD pipeline on Debian Bu
rm get-pip.py
```

**On recent Debian (Bookworm ant later) and Ubuntu (Lunar and later) versions**, the `libpython3.*-stdlib` package ships a file `/usr/lib/python3.*/EXTERNALLY-MANAGED`, which prevents the installation of Python modules outside of `venv` environments.
motionEye however has a small number of dependencies with no strict version requirements and hence is very unlikely to break any Python package you might have installed via APT. To bypass this block, add `break-system-packages=true` to the `[global]` section of your `pip.conf`:
```sh
grep -q '\[global\]' /etc/pip.conf 2> /dev/null || printf '%b' '[global]\n' | sudo tee -a /etc/pip.conf > /dev/null
sudo sed -i '/^\[global\]/a\break-system-packages=true' /etc/pip.conf
```

On **32-bit ARMv6 and ARMv7** systems, additionally configure `pip` to use pre-compiled wheels from [piwheels](https://piwheels.org/):
```sh
printf '%b' '[global]\nextra-index-url=https://www.piwheels.org/simple/\n' | sudo tee /etc/pip.conf > /dev/null
grep -q '\[global\]' /etc/pip.conf 2> /dev/null || printf '%b' '[global]\n' | sudo tee -a /etc/pip.conf > /dev/null
sudo sed -i '/^\[global\]/a\extra-index-url=https://www.piwheels.org/simple/' /etc/pip.conf
```

3. Install and setup **motionEye**
```sh
sudo python3 -m pip install 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz'
sudo python3 -m pip install --pre motioneye
sudo motioneye_init
```
_NB: `motioneye_init` currently assumes either an APT- or RPM-based distribution with `systemd` as init system. For a manual setup, config and service files can be found here: <https://github.com/motioneye-project/motioneye/tree/dev/motioneye/extra>_
Expand All @@ -54,6 +62,6 @@ These install instructions are constantly tested via CI/CD pipeline on Debian Bu

```sh
sudo systemctl stop motioneye
sudo python3 -m pip install --upgrade --force-reinstall --no-deps 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz'
sudo python3 -m pip install --upgrade --pre motioneye
sudo systemctl start motioneye
```
2 changes: 1 addition & 1 deletion motioneye/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.43.0"
VERSION = "0.43.1b1"

0 comments on commit 2862efe

Please sign in to comment.