Skip to content

Commit

Permalink
Merge 2232a35 into 0ab75c1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed May 17, 2024
2 parents 0ab75c1 + 2232a35 commit c0d1590
Show file tree
Hide file tree
Showing 85 changed files with 2,006 additions and 855 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[flake8]
max-line-length = 127
ignore =
# continuation line over-indented for hanging indent
E126,
# continuation line over-indented for visual indent
E127,
# continuation line under-indented for visual indent
Expand Down
17 changes: 17 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# Note: This only checks the modified files
# - docs build of if any python file is staged
# Note: This builds the entire documentation if a changed file goes into the documentation
# - Markdownlint if any markdown file is staged
# Note: This checks all markdown files as configured in .markdownlint-cli2.yaml

#
# If there are problem with this script, commit may still be done with
# git commit --no-verify
Expand Down Expand Up @@ -40,6 +43,20 @@ fi

code=$(( flake8_code + doc_code ))

# Pass all staged markdown files through markdownlint-cli2
MD_FILES="$(git diff --diff-filter=d --staged --name-only -- **/*.md)"
markdownlint_code=0
if [[ -n $MD_FILES ]]; then
echo -e "\n**************************************************************"
echo "Modified Markdown files. Running markdownlint-cli2 ... "
echo -e "**************************************************************\n"
./run_markdownlint.sh
markdownlint_code=$?
echo "Markdownlint-cli2 return code: $markdownlint_code"
fi

code=$(( flake8_code + doc_code + markdownlint_code))

if [[ code -gt 0 ]]; then
echo -e "\n**************************************************************"
echo -e "ERROR(s) during pre-commit checks. Aborting commit!"
Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Please post here the output of 'tail -n 500 /var/log/syslog' or 'journalctl -u m
i.e. `find logfiles at https://paste.ubuntu.com/p/cRS7qM8ZmP/`
-->


## Software

### Base image and version
Expand All @@ -59,7 +58,6 @@ the following command will help with that
i.e. `scripts/installscripts/buster-install-default.sh`
-->


## Hardware

### RaspberryPi version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bundle_webapp_and_release_v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
tar -czvf ${{ steps.vars.outputs.webapp_bundle_name }} build
- name: Artifact Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.vars.outputs.webapp_bundle_name }}
path: ${{ steps.build-webapp.outputs.webapp-root-path }}/${{ steps.vars.outputs.webapp_bundle_name }}
Expand All @@ -119,7 +119,7 @@ jobs:

steps:
- name: Artifact Download
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.webapp_bundle_name }}

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/codeql-analysis_v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,37 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
# Install necessary packages
sudo apt-get update
sudo apt-get install libasound2-dev pulseaudio
python3 -m venv .venv
source ".venv/bin/activate"
python -m pip install --upgrade pip
pip install -r requirements.txt
# Set the `CODEQL-PYTHON` environment variable to the Python executable
# Set the `CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION` environment variable to the Python executable
# that includes the dependencies
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
echo "CODEQL_EXTRACTOR_PYTHON_ANALYSIS_VERSION=$(which python)" >> $GITHUB_ENV
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
setup-python-dependencies: false

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -82,4 +82,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
28 changes: 28 additions & 0 deletions .github/workflows/markdown_v3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Markdown Linting

on:
push:
branches:
- 'future3/**'
paths:
- '**.md'
pull_request:
branches:
- 'future3/**'
paths:
- '**.md'

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Linting markdown
uses: DavidAnson/markdownlint-cli2-action@v15
with:
config: .markdownlint-cli2.yaml
#continue-on-error: true
6 changes: 3 additions & 3 deletions .github/workflows/pythonpackage_future3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/test_docker_debian_codename_sub_v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ jobs:
BASE_TEST_IMAGE=${{ steps.vars.outputs.image_tag_name_local_base }}
- name: Artifact Upload Docker Image
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.vars.outputs.image_file_name }}
path: ${{ steps.vars.outputs.image_file_path }}
retention-days: 1
retention-days: 2


# Run tests with build image
Expand All @@ -159,7 +159,7 @@ jobs:
uses: docker/setup-buildx-action@v3.0.0

- name: Artifact Download Docker Image
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.image_file_name }}

Expand All @@ -179,13 +179,14 @@ jobs:
# cleanup after test execution
cleanup:
# run only if tests didn't fail: keep the artifact to make job reruns possible
if: ${{ !failure() }}
needs: [build, test]
runs-on: ${{ inputs.runs_on }}

steps:
- name: Artifact Delete Docker Image
uses: geekyeggo/delete-artifact@v2
with:
name: ${{ needs.build.outputs.image_file_name }}
# run only if tests didn't fail: keep the artifact to make job reruns possible
if: ${{ !failure() }}
needs: [build, test]
runs-on: ${{ inputs.runs_on }}

steps:
- name: Artifact Delete Docker Image
uses: geekyeggo/delete-artifact@v5
with:
name: ${{ needs.build.outputs.image_file_name }}
failOnError: false
57 changes: 57 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# markdownlint-cli2 configuration, see https://github.com/DavidAnson/markdownlint-cli2?tab=readme-ov-file#configuration
#

# rules, see https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
config:
line-length: false
# ignore dollar signs
commands-show-output: false
no-trailing-punctuation: false
no-duplicate-heading:
siblings_only: true
# allow some tags we use for formatting
no-inline-html:
allowed_elements: [ "details", "summary" ]

# Include a custom rule package
#customRules:
# - markdownlint-rule-titlecase

# Fix no fixable errors
fix: false

# Define a custom front matter pattern
#frontMatter: "<head>[^]*<\/head>"

# Define glob expressions to use (only valid at root)
globs:
- "**.md"

# Define glob expressions to ignore
ignores:
- "documentation/developers/docstring/*"
- "src/**"

# Use a plugin to recognize math
#markdownItPlugins:
# -
# - "@iktakahiro/markdown-it-katex"

# Additional paths to resolve module locations from
#modulePaths:
# - "./modules"

# Enable inline config comments
noInlineConfig: false

# Disable progress on stdout (only valid at root)
noProgress: true

# Use a specific formatter (only valid at root)
#outputFormatters:
# -
# - markdownlint-cli2-formatter-default

# Show found files on stdout (only valid at root)
showFound: true
14 changes: 7 additions & 7 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Contributor Covenant Code of Conduct

Dear Phonieboxians,

As the Phoniebox community is growing, somebody suggested a pull request with the below document. I was hesitant to include it right away, but at the same time I thought: it might be good to have some kind of document to formulate the foundation this project is built on. To tell you the truth, this document is not it. However, it is a start and I thought: why not open this in the spirit of open source, sharing and pull requests and see if and how you or you or you want to change or add parts of this very *standard and corporate* document. Like most of you, I also have a small kid and my time is scarce, I might find some time though to add a bit.

All the best, Micz
> [!NOTE]
> Dear Phonieboxians,
>
> As the Phoniebox community is growing, somebody suggested a pull request with the below document. I was hesitant to include it right away, but at the same time I thought: it might be good to have some kind of document to formulate the foundation this project is built on. To tell you the truth, this document is not it. However, it is a start and I thought: why not open this in the spirit of open source, sharing and pull requests and see if and how you or you or you want to change or add parts of this very *standard and corporate* document. Like most of you, I also have a small kid and my time is scarce, I might find some time though to add a bit.
>
> All the best, Micz
2018-08-21

# Contributor Covenant Code of Conduct

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

## Our Pledge
Expand Down
15 changes: 8 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ as local, temporary scratch areas.

Contributors have played a bigger role over time to keep Phoniebox on the edge of innovation :)

Our goal is to make it simple for you to contribute changes that improve functionality in your specific environment.
To achieve this, we have a set of guidelines that we kindly request contributors to adhere to.
Our goal is to make it simple for you to contribute changes that improve functionality in your specific environment.
To achieve this, we have a set of guidelines that we kindly request contributors to adhere to.
These guidelines help us maintain a streamlined process and stay on top of incoming contributions.

To report bug fixes and improvements, please follow the steps outlined below:

1. For bug fixes and minor improvements, simply open a new issue or pull request (PR).
2. If you intend to port a feature from Version 2.x to future3 or wish to implement a new feature, we recommend reaching out to us beforehand.
- In such cases, please create an issue outlining your plans and intentions.
- We will ensure that there are no ongoing efforts on the same topic.
* In such cases, please create an issue outlining your plans and intentions.
* We will ensure that there are no ongoing efforts on the same topic.

We eagerly await your contributions! You can review the current [feature list](documentation/developers/status.md) to check for available features and ongoing work.

Expand Down Expand Up @@ -108,7 +109,7 @@ Run the checks below on the code. Fix those issues! Or you are running in delays
We provide git hooks for those checks for convenience. To activate

~~~bash
cp .githooks/pre-commit` .git/hooks/.
cp .githooks/pre-commit .git/hooks/.
~~~

### Python Code
Expand Down Expand Up @@ -152,7 +153,7 @@ to detect in advance.

If the code change results in a test failure, we will make our best effort to
correct the error. If a fix cannot be determined and committed within 24 hours
of its discovery, the commit(s) responsible _may_ be reverted, at the
of its discovery, the commit(s) responsible *may* be reverted, at the
discretion of the committer and Phonie maintainers.
The original contributor will be notified of the revert.

Expand All @@ -163,7 +164,7 @@ The original contributor will be notified of the revert.

## Guidelines

* Phoniebox runs on Raspberry Pi OS.
* Phoniebox runs on Raspberry Pi OS.
* Minimum python version is currently **Python 3.9**.

## Additional Resources
Expand Down
25 changes: 9 additions & 16 deletions docker/jukebox.Dockerfile → docker/Dockerfile.jukebox
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM libzmq:local as libzmq
FROM debian:bullseye-slim

# These are only dependencies that are required to get as close to the
Expand All @@ -6,8 +7,7 @@ RUN apt-get update && apt-get install -y \
libasound2-dev \
pulseaudio \
pulseaudio-utils \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
--no-install-recommends

ARG UID
ARG USER
Expand All @@ -21,7 +21,7 @@ RUN usermod -aG pulse ${USER}
# Install all Jukebox dependencies
RUN apt-get update && apt-get install -qq -y \
--allow-downgrades --allow-remove-essential --allow-change-held-packages \
g++ at wget \
build-essential at wget \
espeak mpc mpg123 git ffmpeg spi-tools netcat \
python3 python3-venv python3-dev python3-mutagen

Expand All @@ -37,21 +37,14 @@ ENV VIRTUAL_ENV=${INSTALLATION_PATH}/.venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"


# Install all Python dependencies
RUN pip install --no-cache-dir -r ${INSTALLATION_PATH}/requirements.txt

ENV ZMQ_TMP_DIR libzmq
ENV ZMQ_VERSION 4.3.5
ENV ZMQ_PREFIX /usr/local

RUN [ "$(uname -m)" = "aarch64" ] && ARCH="arm64" || ARCH="$(uname -m)"; \
wget https://github.com/pabera/libzmq/releases/download/v${ZMQ_VERSION}/libzmq5-${ARCH}-${ZMQ_VERSION}.tar.gz -O libzmq.tar.gz; \
tar -xzf libzmq.tar.gz -C ${ZMQ_PREFIX}; \
rm -f libzmq.tar.gz;

RUN export ZMQ_PREFIX=${PREFIX} && export ZMQ_DRAFT_API=1
RUN pip install -v --no-binary pyzmq pyzmq
# Install pyzmq Python dependency separately
ENV ZMQ_PREFIX /opt/libzmq
ENV ZMQ_DRAFT_API 1
COPY --from=libzmq ${ZMQ_PREFIX} ${ZMQ_PREFIX}
RUN pip install -v "pyzmq<26" --no-binary pyzmq

EXPOSE 5555 5556

WORKDIR ${INSTALLATION_PATH}/src/jukebox

0 comments on commit c0d1590

Please sign in to comment.