Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

future3 - Move docs back to Github & markdown #2085

Merged
merged 30 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6f8b6b7
Start moving docs to markdown
pabera Oct 29, 2023
6714203
update userguide
pabera Oct 29, 2023
a777e49
add more pages
pabera Oct 30, 2023
19df93d
Rename index.md
pabera Nov 2, 2023
88e8423
Undo last commit
pabera Nov 2, 2023
45d1038
Add autohotspot
pabera Nov 2, 2023
e62ad63
Finish userguide without references
pabera Nov 2, 2023
576a95f
Rename bt audio btns
pabera Nov 2, 2023
3beb6f6
Adding developers and rfid
pabera Nov 2, 2023
5e35ce8
docker: optimizations (#2074)
notapirate Nov 3, 2023
4d19a2c
Start moving docs to markdown
pabera Oct 29, 2023
c590275
update userguide
pabera Oct 29, 2023
70e85ff
add more pages
pabera Oct 30, 2023
4dfa1b7
Rename index.md
pabera Nov 2, 2023
2932822
Undo last commit
pabera Nov 2, 2023
d2de554
Add autohotspot
pabera Nov 2, 2023
bad617a
Finish userguide without references
pabera Nov 2, 2023
39e7dad
Rename bt audio btns
pabera Nov 2, 2023
cb8a4e2
Adding developers and rfid
pabera Nov 2, 2023
43d73b9
Merge branch 'markdown-doc' of https://github.com/pabera/RPi-Jukebox-…
pabera Nov 4, 2023
d66afed
Rename docs to documentation
pabera Nov 4, 2023
0a4c8ab
Update document structure
pabera Nov 4, 2023
8415fc5
Move rfid to developers
pabera Nov 4, 2023
23abee3
Remove sphinx
pabera Nov 4, 2023
6f55597
Remove even more sphinx
pabera Nov 4, 2023
e1c6aeb
Test pydoc
pabera Nov 5, 2023
815c21d
Revert "Test pydoc"
pabera Nov 5, 2023
a707a24
Moving sphinx for api and command reference
pabera Nov 10, 2023
3b23e7c
Remove Sphinx for good
pabera Nov 11, 2023
fdec631
update paths to developers
pabera Nov 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
.git
.githooks
.github
.dockerignore
.DS_Store

# Application
docker
docs
installation
src
shared

# webapp
Expand Down
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ filename = *.py,*.py.*
extend-exclude =
# Ignore all scratch development directories
scratch*,
# The conf file is mostly autogenerated, ignore it
docs/sphinx/conf.py,
# Ignore dirs and files that have not been ported yet
*/jukebox/NvManager.py
# ignore GitHub Codespaces
Expand Down
13 changes: 1 addition & 12 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@ if [[ -n $PY_FILES ]]; then
echo "Flake8 return code: $flake8_code"
fi

DOC_FILES="$(git diff --diff-filter=d --staged --name-only -- docs/sphinx/*)"
sphinx_code=0
if [[ -n $DOC_FILES || -n $PY_FILES ]]; then
echo -e "\n**************************************************************"
echo -e "Files for documentation modified. Testing re-build of docs ... \n"
echo -e "**************************************************************\n"
./run_sphinx.sh -c
sphinx_code=$?
echo "Sphinx return code: $sphinx_code"
fi

code=$(( flake8_code + sphinx_code ))
code=$(( flake8_code ))

if [[ code -gt 0 ]]; then
echo -e "\n**************************************************************"
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/pythonpackage_future3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ on:
paths:
- '**.py'
- '**.py.*'
- 'docs/sphinx/**'
pull_request:
branches:
- 'future3/**'
paths:
- '**.py'
- '**.py.*'
- 'docs/sphinx/**'

jobs:
build:
Expand All @@ -40,9 +38,6 @@ jobs:
pip3 install spidev
pip3 install -r requirements.txt
# For operation of the Jukebox, ZMQ must be compiled from sources due to Websocket support
# When just building the docs, the regular ZMQ package is sufficient
pip3 install -r docs/sphinx/requirements_pyzmq.txt
pip3 install -r docs/sphinx/requirements.txt
# Also install all optional dependencies
pip3 install -r src/jukebox/components/rfid/hardware/fake_reader_gui/requirements.txt
pip3 install -r src/jukebox/components/rfid/hardware/pn532_i2c_py532/requirements.txt
Expand All @@ -53,9 +48,3 @@ jobs:
pip3 install flake8
# Stop the build if linting fails
./run_flake8.sh
- name: Build the docs
working-directory: ./docs/sphinx
run: |
# Stop the build if documentation cannot be built
# Treat all warnings as errors
sphinx-build -W --keep-going -T -a -E -b html . _build
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
/shared/*.*
/shared/*

# Documentation builder
/docs/sphinx/_build/

# Application
/src/cli_client/pbc

Expand Down
28 changes: 0 additions & 28 deletions .readthedocs.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ The Jukebox core app is written entirely in Python. Therefore, we follow the [Py

* **Documentation**
* You are expected to write some Documentation. It's easy. **Very** easy actually with [Python Docstrings](https://www.geeksforgeeks.org/python-docstrings/)
* If you dare, you may add the python documentation reference to the Sphinx documentation build. But we are also ok with doing that for you

# Structure of files and folders

Expand All @@ -38,8 +37,6 @@ Inside the root folder or the repo, these folders are important:
* contains the Python packages that are loaded using the plugin interface
* `src/webapp`
* contains the Web Interface
* `src/docs/sphinx`
* contains the documentation sources and build flow using Sphinx

All folders on all hierarchy levels starting with `scratch*` are ignored by git and flake8. These are intended
as local, temporary scratch areas.
Expand Down Expand Up @@ -132,18 +129,6 @@ cd /home/pi/RPi-Jukebox-RFID
If you are convinced some issue should not apply to your case or would require extensive re-coding, that could be OK.
Let us know in the pull request - we will look at it.

### Documentation

When adding or improving documentation, build the documentation and look at it locally.
If you are contributing to existing Python modules, be aware that these are already included in the documentation flow.
Also run through this step in this case! Fix all warnings!

~~~bash
$ cd /home/pi/RPi-Jukebox-RFID/
$ ./run_sphinx.sh
# open and check the result: 'file:///path/to/RPi-Jukebox-RFID/docs/sphinx/_build/html/index.html'
~~~

### Tests

Tests are very few at the moment, but it cannot hurt to run them. If you have tests for your new modules, please add
Expand Down
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,7 @@ project check out the [documentation of Version 2](<https://github.com/MiczFlor/

## Where are the Help pages?

### Online

Read the documentation at [Readthedocs.io](https://rpi-jukebox-rfid.readthedocs.io/en/latest/)

### Local

Alternatively, build the help locally:

~~~bash
cd docs/sphinx
make
~~~

Then navigate your browser to

~~~bash
file:///path/to/RPi-Jukebox-RFID/docs/sphinx/_build/html/docs/index.html
~~~
The documentation can be found [here](documentation)

## Installation?

Expand Down
41 changes: 20 additions & 21 deletions docker/armv7/jukebox.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@ FROM arm32v7/debian:buster-slim
# These are only dependencies that are required to get as close to the
# Raspberry Pi environment as possible.
RUN apt-get update && apt-get install -y \
alsa-utils \
libasound2-dev \
libasound2-plugins \
pulseaudio \
pulseaudio-utils \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

RUN usermod -aG audio,pulse,pulse-access root
ARG UID
ARG USER
ARG HOME
ENV INSTALLATION_PATH ${HOME}/RPi-Jukebox-RFID

ENV HOME /root
ENV MPD_HOST mpd
ENV INSTALLATION_DIR /home/pi/RPi-Jukebox-RFID
ENV DOCKER_DIR ${INSTALLATION_DIR}/docker

WORKDIR $INSTALLATION_DIR
RUN test ${UID} -gt 0 && useradd -m -u ${UID} ${USER} || continue
RUN usermod -aG pulse ${USER}

# Jukebox
# Install all Jukebox dependencies
Expand All @@ -34,13 +31,12 @@ RUN apt-get update && apt-get install -qq -y \
#resolvconf
#python3-spidev

COPY . ${INSTALLATION_DIR}

# Install Jukebox
# Install libzmq with Websocket support from pre-compiled source
ENV ZMQ_TMP_DIR libzmq
ENV ZMQ_PREFIX /usr/local
RUN cd ${HOME} && mkdir ${ZMQ_TMP_DIR} && cd ${ZMQ_TMP_DIR}; \
ENV ZMQ_TMP_DIR "/root/libzmq"
ENV ZMQ_PREFIX "/usr/local"
ENV ZMQ_DRAFT_API 1
RUN mkdir -p ${ZMQ_TMP_DIR} && cd ${ZMQ_TMP_DIR}; \
wget --quiet --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1KP6BqLF-i2dCUsHhOUpOwwuOmKsB5GKY' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1KP6BqLF-i2dCUsHhOUpOwwuOmKsB5GKY" -O libzmq.tar.gz && rm -rf /tmp/cookies.txt; \
tar -xzf libzmq.tar.gz; \
rm -f libzmq.tar.gz; \
Expand All @@ -49,26 +45,29 @@ RUN cd ${HOME} && mkdir ${ZMQ_TMP_DIR} && cd ${ZMQ_TMP_DIR}; \
# Install libzmq with Websocket and compile
# ENV LIBSODIUM_VERSION 1.0.18
# ENV ZMQ_VERSION 4.3.4
# RUN cd ${HOME} && mkdir ${ZMQ_TMP_DIR} && cd ${ZMQ_TMP_DIR}; \
# RUN mkdir -p ${ZMQ_TMP_DIR} && cd ${ZMQ_TMP_DIR}; \
# wget --quiet https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}-RELEASE/libsodium-${LIBSODIUM_VERSION}.tar.gz; \
# tar -zxvf libsodium-${LIBSODIUM_VERSION}.tar.gz; \
# cd libsodium-${LIBSODIUM_VERSION}/; \
# ./configure; \
# make && make install
# RUN cd ${HOME}/${ZMQ_TMP_DIR}; \
# RUN cd ${ZMQ_TMP_DIR}; \
# wget https://github.com/zeromq/libzmq/releases/download/v${ZMQ_VERSION}/zeromq-${ZMQ_VERSION}.tar.gz -O libzmq.tar.gz; \
# tar -xzf libzmq.tar.gz; \
# zeromq-${ZMQ_VERSION}/configure --prefix=${ZMQ_PREFIX} --enable-drafts; \
# make && make install;

RUN pip3 install --pre pyzmq \
--install-option=--enable-drafts \
--install-option=--zmq=${ZMQ_PREFIX}
USER ${USER}
WORKDIR ${HOME}
COPY --chown=${USER}:${USER} . ${INSTALLATION_PATH}/

RUN pip3 install --no-cache-dir -r ${INSTALLATION_DIR}/requirements.txt
RUN pip3 install --no-cache-dir -r ${INSTALLATION_PATH}/requirements.txt
RUN pip3 install --no-cache-dir --pre --no-binary pyzmq pyzmq

EXPOSE 5555 5556

WORKDIR ${INSTALLATION_PATH}/src/jukebox

# Run Jukebox
# CMD bash
CMD python3 ${INSTALLATION_DIR}/src/jukebox/run_jukebox.py
CMD python3 ${INSTALLATION_PATH}/src/jukebox/run_jukebox.py
4 changes: 2 additions & 2 deletions docker/config/docker.pulse.mpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory "/home/pi/RPi-Jukebox-RFID/shared/audiofolders"
music_directory "~/RPi-Jukebox-RFID/shared/audiofolders"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use
Expand Down Expand Up @@ -67,7 +67,7 @@ sticker_file "~/.config/mpd/sticker.sql"
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
user "root"
# user "root"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
Expand Down
5 changes: 0 additions & 5 deletions docker/config/jukebox.overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
playermpd:
host: mpd
mpd_conf: /etc/mpd.conf
pulse:
outputs:
primary:
pulse_sink_name: Channel_1__Channel_2.2
39 changes: 29 additions & 10 deletions docker/docker-compose.linux.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
version: "3.9"

services:
mpd:
devices:
- /dev/snd

jukebox:
devices:
- /dev/snd
version: "3.9"

services:
mpd:
build:
args:
- UID=${UID:-1000}
- USER=pi
- HOME=/home/pi
environment:
- PULSE_SERVER=unix:/tmp/pulse-sock
volumes:
- ../shared/audiofolders:/home/pi/RPi-Jukebox-RFID/shared/audiofolders
- ../shared/playlists:/home/pi/.config/mpd/playlists
- ./config/docker.pulse.mpd.conf:/home/pi/.config/mpd/mpd.conf
- $XDG_RUNTIME_DIR/pulse/native:/tmp/pulse-sock

jukebox:
build:
args:
- UID=${UID:-1000}
- USER=pi
- HOME=/home/pi
environment:
- PULSE_SERVER=unix:/tmp/pulse-sock
volumes:
- ../shared:/home/pi/RPi-Jukebox-RFID/shared
- ./config/docker.pulse.mpd.conf:/home/pi/.config/mpd/mpd.conf
- $XDG_RUNTIME_DIR/pulse/native:/tmp/pulse-sock
5 changes: 0 additions & 5 deletions docker/docker-compose.mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ version: "3.9"

services:
mpd:
environment:
- PULSE_SERVER=tcp:host.docker.internal:4713
volumes:
- ./config/docker.pulse.mpd.conf:/root/.config/mpd/mpd.conf:rw
- ~/.config/pulse:/root/.config/pulse
- /usr/local/Cellar/pulseaudio/14.2/etc/pulse:/etc/pulse

jukebox:
environment:
- PULSE_SERVER=tcp:host.docker.internal:4713
volumes:
- ~/.config/pulse:/root/.config/pulse
- /usr/local/Cellar/pulseaudio/14.2/etc/pulse:/etc/pulse
12 changes: 0 additions & 12 deletions docker/docker-compose.windows.yml

This file was deleted.

Loading