diff --git a/.forgejo/workflows/docker-image.yaml b/.forgejo/workflows/docker-image.yaml new file mode 100644 index 0000000..4362053 --- /dev/null +++ b/.forgejo/workflows/docker-image.yaml @@ -0,0 +1,31 @@ +name: docker-image + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: git.hamburg.ccc.de + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: git.hamburg.ccc.de/ccchh/hmdooris/hmdooris:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5ef0cca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM docker.io/library/debian:12-slim AS builder +RUN apt-get update && \ + apt-get install --no-install-suggests --no-install-recommends --yes python3 pipx +ENV PATH="/root/.local/bin:${PATH}" +RUN pipx install poetry +RUN pipx inject poetry poetry-plugin-bundle +WORKDIR /src +COPY . . +RUN ln -s /usr/bin/python3 /usr/bin/python +RUN poetry bundle venv --python=/usr/bin/python3 --only=main /venv + +FROM gcr.io/distroless/python3-debian12 +COPY --from=builder /venv /venv +COPY buba/ /buba +ENTRYPOINT ["/venv/bin/python", "-m", "hmdooris"] \ No newline at end of file diff --git a/buba/__init__.py b/buba/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/buba/__main__.py b/buba/__main__.py new file mode 100644 index 0000000..3f3def1 --- /dev/null +++ b/buba/__main__.py @@ -0,0 +1,9 @@ + +from pyfis.aegmis import MIS1TextDisplay + + +display = MIS1TextDisplay("/dev/ttyUSB3",) +display.simple_text(page=1, row=0, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER) +display.simple_text(page=1, row=1, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER) +display.simple_text(page=1, row=2, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER) +display.simple_text(page=1, row=3, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER) diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..c7cbc9e --- /dev/null +++ b/poetry.lock @@ -0,0 +1,36 @@ +# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. + +[[package]] +name = "pyfis" +version = "1.13.0" +description = "A library for controlling devices in the passenger information realm" +optional = false +python-versions = "*" +groups = ["main"] +files = [ + {file = "pyFIS-1.13.0-py3-none-any.whl", hash = "sha256:fe70ec50cf19443ca4c806dc812c72d6a0c1bdac845792518234e4632a10f14d"}, + {file = "pyFIS-1.13.0.tar.gz", hash = "sha256:bd064534b422d01ab55c4335a8ba22591605e95de919e5da0e6f38e5f38efdb8"}, +] + +[package.dependencies] +pyserial = "*" + +[[package]] +name = "pyserial" +version = "3.5" +description = "Python Serial Port Extension" +optional = false +python-versions = "*" +groups = ["main"] +files = [ + {file = "pyserial-3.5-py2.py3-none-any.whl", hash = "sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0"}, + {file = "pyserial-3.5.tar.gz", hash = "sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb"}, +] + +[package.extras] +cp2110 = ["hidapi"] + +[metadata] +lock-version = "2.1" +python-versions = ">=3.10,<4.0" +content-hash = "26406bd0806bf5a00f187b6cbe55ea0b681e558d2af61096a298196d659a869f" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..38639da --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "buba" +version = "0.1.0" +description = "" +authors = [ + {name = "Stefan Bethke",email = "stb@lassitu.de"} +] +readme = "README.md" +requires-python = ">=3.10,<4.0" +dependencies = [ + "pyfis (>=1.13.0,<2.0.0)" +] + + +[build-system] +requires = ["poetry-core>=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api"