Skip to content

Commit 2862efe

Browse files
authored
[CI/CD] Add PyPi release workflow to dev branch (#2675)
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>
1 parent 63a4493 commit 2862efe

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

.github/workflows/pypi_release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PyPI release
2+
3+
on: workflow_dispatch
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.x'
16+
check-latest: true
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip setuptools wheel
20+
python -m pip install --upgrade build twine
21+
- name: Build package
22+
run: python -m build
23+
- name: Publish package
24+
#run: twine upload -r testpypi -u '__token__' -p '${{ secrets.TEST_PYPI_API_TOKEN }}' dist/*
25+
run: twine upload -r pypi -u '__token__' -p '${{ secrets.PYPI_TOKEN }}' dist/*

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ These install instructions are constantly tested via CI/CD pipeline on Debian Bu
1919

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

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

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

41+
**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.
42+
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`:
43+
```sh
44+
grep -q '\[global\]' /etc/pip.conf 2> /dev/null || printf '%b' '[global]\n' | sudo tee -a /etc/pip.conf > /dev/null
45+
sudo sed -i '/^\[global\]/a\break-system-packages=true' /etc/pip.conf
46+
```
47+
4148
On **32-bit ARMv6 and ARMv7** systems, additionally configure `pip` to use pre-compiled wheels from [piwheels](https://piwheels.org/):
4249
```sh
43-
printf '%b' '[global]\nextra-index-url=https://www.piwheels.org/simple/\n' | sudo tee /etc/pip.conf > /dev/null
50+
grep -q '\[global\]' /etc/pip.conf 2> /dev/null || printf '%b' '[global]\n' | sudo tee -a /etc/pip.conf > /dev/null
51+
sudo sed -i '/^\[global\]/a\extra-index-url=https://www.piwheels.org/simple/' /etc/pip.conf
4452
```
4553

4654
3. Install and setup **motionEye**
4755
```sh
48-
sudo python3 -m pip install 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz'
56+
sudo python3 -m pip install --pre motioneye
4957
sudo motioneye_init
5058
```
5159
_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>_
@@ -54,6 +62,6 @@ These install instructions are constantly tested via CI/CD pipeline on Debian Bu
5462

5563
```sh
5664
sudo systemctl stop motioneye
57-
sudo python3 -m pip install --upgrade --force-reinstall --no-deps 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz'
65+
sudo python3 -m pip install --upgrade --pre motioneye
5866
sudo systemctl start motioneye
5967
```

motioneye/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.43.0"
1+
VERSION = "0.43.1b1"

0 commit comments

Comments
 (0)