Skip to content

Commit 5044358

Browse files
authored
Merge pull request #2368 from MiczFlor/develop
Release v2.8.0
2 parents 550a258 + 91ba1aa commit 5044358

37 files changed

Lines changed: 318 additions & 171 deletions

.flake8

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
[flake8]
2-
max-line-length = 120
2+
max-line-length = 127
33
ignore =
4+
# continuation line over-indented for hanging indent
5+
E126,
46
# continuation line over-indented for visual indent
57
E127,
68
# continuation line under-indented for visual indent
7-
E128
9+
E128,
10+
# line break before binary operator
11+
W503,
12+
# We don't always want periods at the end of the first docstring line
13+
D400,
14+
# We dont rephrase to imperative mood
15+
D401
816
per-file-ignores =
917
# Only in __init__files ignore imported but unused
1018
# Not necessary, if __all__ is declared in __init__ file
1119
# https://www.python.org/dev/peps/pep-0008/#id48
12-
__init__.py:F401
20+
__init__.py:F401,
21+
components/smart-home-automation/MQTT-protocol/daemon_mqtt_client.py:W605,
22+
components/controls/buttons_usb_encoder/*.py:E402
23+
count = True
24+
max-complexity = 12
25+
statistics = True
26+
show-source = True
27+
filename = *.py,*.py.*
28+
extend-exclude =
29+
# Ignore dirs and files, which are from external sources
30+
components/displays/HD44780-i2c/
31+
scripts/Reader.py.pcsc
32+
# Ignore helper scripts
33+
scripts/helperscripts/

.github/workflows/markdown.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Markdown Linting
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'future3/**'
7+
paths:
8+
- '**.md'
9+
pull_request:
10+
branches:
11+
- develop
12+
- master
13+
paths:
14+
- '**.md'
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Linting markdown
26+
uses: DavidAnson/markdownlint-cli2-action@v17
27+
with:
28+
config: .markdownlint-cli2.yaml
29+
#continue-on-error: true

.github/workflows/pythonpackage.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ jobs:
3030
pip install spidev
3131
pip install -r requirements.txt
3232
pip install -r requirements-GPIO.txt
33+
- name: Setup flake8 annotations
34+
uses: rbialon/flake8-annotations@v1
3335
- name: Lint with flake8
3436
run: |
3537
pip install flake8
36-
# stop the build if there are Python syntax errors or undefined names
37-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --filename=*.py,*.py.*
38-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --filename=*.py,*.py.*
38+
flake8 --config .flake8
4039
- name: Test with pytest
4140
run: |
4241
pytest --cov --cov-config=.coveragerc --cov-report xml

.github/workflows/test_docker_debian_codename_sub.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ jobs:
5555
- uses: actions/checkout@v4
5656

5757
- name: Set up QEMU
58-
uses: docker/setup-qemu-action@v3.0.0
58+
uses: docker/setup-qemu-action@v3.2.0
5959

6060
- name: Set up Docker Buildx
61-
uses: docker/setup-buildx-action@v3.2.0
61+
uses: docker/setup-buildx-action@v3.7.1
6262
with:
6363
# network=host driver-opt needed to push to local registry
6464
driver-opts: network=host
@@ -94,7 +94,7 @@ jobs:
9494
9595
# Build base image for debian version name. Layers will be cached and image pushes to local registry
9696
- name: Build Image - Base
97-
uses: docker/build-push-action@v5
97+
uses: docker/build-push-action@v6
9898
with:
9999
context: .
100100
load: false
@@ -112,7 +112,7 @@ jobs:
112112
113113
# Build new image with updates packages based on base image. Layers will NOT be chached. Result is written to file.
114114
- name: Build Image - Update
115-
uses: docker/build-push-action@v5
115+
uses: docker/build-push-action@v6
116116
with:
117117
context: .
118118
load: false
@@ -152,10 +152,10 @@ jobs:
152152

153153
steps:
154154
- name: Set up QEMU
155-
uses: docker/setup-qemu-action@v3.0.0
155+
uses: docker/setup-qemu-action@v3.2.0
156156

157157
- name: Set up Docker Buildx
158-
uses: docker/setup-buildx-action@v3.2.0
158+
uses: docker/setup-buildx-action@v3.7.1
159159

160160
- name: Artifact Download Docker Image
161161
uses: actions/download-artifact@v4

.markdownlint-cli2.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# markdownlint-cli2 configuration, see https://github.com/DavidAnson/markdownlint-cli2?tab=readme-ov-file#configuration
3+
#
4+
5+
# rules, see https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
6+
config:
7+
line-length: false
8+
# ignore dollar signs
9+
commands-show-output: false
10+
no-trailing-punctuation: false
11+
no-duplicate-heading:
12+
siblings_only: true
13+
# allow some tags we use for formatting
14+
no-inline-html:
15+
allowed_elements: [ "details", "summary" ]
16+
17+
# Include a custom rule package
18+
#customRules:
19+
# - markdownlint-rule-titlecase
20+
21+
# Fix no fixable errors
22+
fix: false
23+
24+
# Define a custom front matter pattern
25+
#frontMatter: "<head>[^]*<\/head>"
26+
27+
# Define glob expressions to use (only valid at root)
28+
globs:
29+
- "**.md"
30+
31+
# Define glob expressions to ignore
32+
ignores:
33+
- "htdocs/**"
34+
35+
# Use a plugin to recognize math
36+
#markdownItPlugins:
37+
# -
38+
# - "@iktakahiro/markdown-it-katex"
39+
40+
# Additional paths to resolve module locations from
41+
#modulePaths:
42+
# - "./modules"
43+
44+
# Enable inline config comments
45+
noInlineConfig: false
46+
47+
# Disable progress on stdout (only valid at root)
48+
noProgress: true
49+
50+
# Use a specific formatter (only valid at root)
51+
#outputFormatters:
52+
# -
53+
# - markdownlint-cli2-formatter-default
54+
55+
# Show found files on stdout (only valid at root)
56+
showFound: true

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Phoniebox is a contactless jukebox for the Raspberry Pi, playing audio files, pl
1919

2020
Another bunch of wonderful designs!
2121

22-
To share your design or see all previous calendars and designs of the community visit the [Phoniebox Gallery](https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/GALLERY).
22+
To share your design or see all previous calendars and designs of the community visit the [Phoniebox Gallery](https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/GALLERY).
2323

2424
![The Phoniebox Calendar](https://raw.githubusercontent.com/wiki/MiczFlor/RPi-Jukebox-RFID/img/gallery/calendar/latest-Phoniebox-Calendar.jpg "The Phoniebox Calendar")
2525

@@ -141,7 +141,8 @@ There is a growing section of [troubleshooting](https://github.com/MiczFlor/RPi-
141141

142142
Here is a list of equipment needed. You can find a lot second hand online (save money and the planet). The links below lead to Amazon, not at all because I want to support them, but because their PartnerNet program helps to support the Phoniebox maintenance (a little bit...).
143143

144-
Note: depending on individual projects, the hardware requirements vary.
144+
> [!NOTE]
145+
> Depending on individual projects, the hardware requirements vary.
145146
146147
### Raspberry Pi
147148

@@ -189,6 +190,8 @@ These are links to additional items, which will add an individual flavour to you
189190
Special hardware is now organised in the folder [`components`](components/). If you have new hardware attached to your Phoniebox, please add to this library! It currently contains soundcards, displays, GPIO controls, RFID reader, smarthome integration.
190191

191192
## Support Phoniebox
193+
<!-- markdownlint-disable MD033 -->
194+
<!-- markdownlint-disable MD045 -->
192195

193196
<a href="https://www.buymeacoffee.com/MiczFlor" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"></a>
194197

@@ -211,6 +214,8 @@ See the Phoniebox code in action, watch this video and read the blog post from [
211214

212215
A new video screencast about
213216

217+
<!-- markdownlint-restore -->
218+
214219
**What makes this Phoniebox easy to install and use:**
215220

216221
* Runs on all Raspberry Pi models (1, 2, 3 and 4) and [Raspberry Zero](https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/15).
@@ -243,7 +248,6 @@ See innovation, upcycling and creativity in the [Phoniebox Gallery](https://gith
243248
![Caption](https://raw.githubusercontent.com/wiki/MiczFlor/RPi-Jukebox-RFID/img/gallery/KingKahn-20180101-Jukebox-01-h90.jpg)
244249
![Caption](https://raw.githubusercontent.com/wiki/MiczFlor/RPi-Jukebox-RFID/img/gallery/hailogugo-20171222-h90-01.jpg)
245250

246-
247251
## Sustainability
248252

249253
You might be surprised how easy and affordable you can get a RaspberryPi or an "appropriate" housing for your Phoniebox **second hand**. Think about the planet before you buy a new one.

ci/Dockerfile.debian

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Base Target to build and install all needed base configuration and packages. Specifie the needed platform with the docker '--platform XXX' option
22
ARG DEBIAN_CODENAME=bullseye
33
ARG BASE_TEST_IMAGE=test-code
4-
FROM debian:${DEBIAN_CODENAME}-slim as base
4+
FROM debian:${DEBIAN_CODENAME}-slim AS base
55
ARG DEBIAN_CODENAME
66

77
ENV DOCKER_RUNNING=true
@@ -34,7 +34,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
3434
# ------
3535

3636
# Base Target for setting up the default user. user can be selected with the docker '--user YYY' option
37-
FROM base as user
37+
FROM base AS user
3838
ARG USER=pi
3939
ARG USER_GROUP=$USER
4040

@@ -50,7 +50,7 @@ RUN groupadd --gid 1000 $USER_GROUP \
5050
####### Code Targets #######
5151

5252
# Target for adding code from the repo. Set Default User
53-
FROM user as code
53+
FROM user AS code
5454

5555
COPY --chown=$USER:$USER_GROUP --chmod=770 . /code
5656
WORKDIR /code
@@ -63,7 +63,7 @@ USER $USER
6363
####### Test Targets #######
6464

6565
# Target for setting up an alternativ user 'hans:wurst'. user can be selected with the docker '--user YYY' option
66-
FROM user as test-user
66+
FROM user AS test-user
6767

6868
ENV TEST_USER_GROUP=test
6969

@@ -79,7 +79,7 @@ RUN export USER_ALT=hans \
7979

8080

8181
# Target for adding envs and scripts from the repo to test installation
82-
FROM test-user as test-code
82+
FROM test-user AS test-code
8383
ARG GIT_BRANCH
8484
ARG GIT_URL
8585

@@ -104,7 +104,7 @@ COPY --chown=root:$TEST_USER_GROUP --chmod=770 scripts/installscripts/tests/*.sh
104104

105105

106106
# Target for applying latest updates (should not be cached!)
107-
FROM $BASE_TEST_IMAGE as test-update
107+
FROM $BASE_TEST_IMAGE AS test-update
108108
RUN export DEBIAN_FRONTEND=noninteractive \
109109
&& apt-get update \
110110
&& apt-get -y upgrade \

ci/README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,42 @@ This is a work in progress so expect things to fail or being flaky.
1111
* Flash its sd card with **Raspberry Pi OS lite**
1212
* use raspi-config to resize the filesystem to the whole sd card (menu: 7 -> A1)
1313
* install some tools and reboot:
14-
```bash
14+
15+
```bash
1516
sudo apt-get update
1617
sudo apt-get -y dist-upgrade
1718
sudo apt-get -y install docker.io git
1819
sudo gpasswd -a pi docker
1920
sudo reboot
20-
```
21+
```
22+
2123
* login to your RPi
2224
* clone the repo and cd into its local clone:
23-
```bash
25+
26+
```bash
2427
cd /home/pi/
2528
# optional: change to your fork appropriately
2629
git clone https://github.com/MiczFlor/RPi-Jukebox-RFID.git
2730
cd RPi-Jukebox-RFID/
2831
# optional: switch to another branch
2932
git checkout <branch_name>
30-
```
33+
```
34+
3135
* build the docker image:
36+
3237
```bash
3338
docker build -t rpi-jukebox-rfid:debian-latest -f ci/Dockerfile.debian --platform=linux/arm/v7 --target=code .
3439
```
35-
* additional arguments
36-
* for builds
37-
- on normal PCs use `--platform=linux/amd64`
38-
- on a raspberry pi use `--platform=linux/arm/v7`
39-
* to use a different debian version as base add parameter `--build-arg="DEBIAN_CODENAME=<code_name>"` (<code_name> = e.g. buster, bullseye, ...).
40+
41+
* additional arguments
42+
* for builds
43+
* on normal PCs use `--platform=linux/amd64`
44+
* on a raspberry pi use `--platform=linux/arm/v7`
45+
* to use a different debian version as base add parameter `--build-arg="DEBIAN_CODENAME=<code_name>"` (<code_name> = e.g. buster, bullseye, ...).
4046

4147
* get something to drink or eat
4248
* run the freshly built docker image and start testing. For example:
49+
4350
```bash
4451
docker run --rm -ti rpi-jukebox-rfid:debian-latest /bin/bash
4552
cd /home/pi/
@@ -48,12 +55,14 @@ This is a work in progress so expect things to fail or being flaky.
4855
bash GIT_URL=https://github.com/MiczFlor/RPi-Jukebox-RFID.git GIT_BRANCH=main install-jukebox.sh
4956
```
5057

51-
NOTE: Get familiar with docker and its flags - `--rm` for example will remove the
52-
container after you log out of it and all changes will be lost.
58+
> [!NOTE]
59+
> Get familiar with docker and its flags - `--rm` for
60+
> example will remove the
61+
> container after you log out of it and all changes will be lost.
5362

5463
### mount hosts code as volume
5564

56-
The created image now contains all the code in the directory `/code` - if you do not want to rebuild the image after each code-change you can 'mount' the RPi's code version into the container.
65+
The created image now contains all the code in the directory `/code` - if you do not want to rebuild the image after each code-change you can 'mount' the RPi's code version into the container.
5766
Add `-w /code -v $PWD:/code` to the `docker run` parameter.
5867
5968
In that way every change to the code in the container will be available on the RPi as well as vice versa.

0 commit comments

Comments
 (0)