-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate to poetry * update Dockerfile for poetry * remove version from __init__.py, add "--rm" to docker example, add missing sudo binary * fix Dockerfile * update poetry version in Dockerfile * update workflows
- Loading branch information
1 parent
5b3f049
commit a3be1e8
Showing
11 changed files
with
1,170 additions
and
1,370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
# Docker image for barcode-server | ||
|
||
# dont use alpine for python builds: https://pythonspeed.com/articles/alpine-docker-python/ | ||
FROM python:3.11-slim-buster | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
ENV POETRY_VERSION="1.4.1" | ||
ENV PIP_DISABLE_PIP_VERSION_CHECK=on | ||
ENV VENV_HOME=/opt/poetry | ||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
COPY poetry.lock pyproject.toml ./ | ||
RUN apt-get update \ | ||
&& apt-get -y install sudo python3-pip python3-evdev \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
RUN pip install --upgrade pip;\ | ||
pip3 install evdev;\ | ||
pip install pipenv;\ | ||
PIP_IGNORE_INSTALLED=1 pipenv install --system --deploy;\ | ||
pip install . | ||
&& apt-get -y install sudo python3-pip python3-evdev \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \ | ||
&& python3 -m venv ${VENV_HOME} \ | ||
&& ${VENV_HOME}/bin/pip install --upgrade pip \ | ||
&& ${VENV_HOME}/bin/pip install "poetry==${POETRY_VERSION}" \ | ||
&& ${VENV_HOME}/bin/poetry check \ | ||
&& POETRY_VIRTUALENVS_CREATE=false ${VENV_HOME}/bin/poetry install --no-interaction --no-cache --only main \ | ||
&& ${VENV_HOME}/bin/pip uninstall -y poetry | ||
|
||
# Add Poetry to PATH | ||
ENV PATH="${VENV_HOME}/bin:${PATH}" | ||
|
||
COPY docker docker | ||
COPY barcode_server barcode_server | ||
COPY README.md README.md | ||
|
||
RUN ${VENV_HOME}/bin/pip install . | ||
|
||
ENV PUID=1000 PGID=1000 | ||
|
||
ENTRYPOINT [ "docker/entrypoint.sh", "barcode-server" ] | ||
ENTRYPOINT "docker/entrypoint.sh" "${VENV_HOME}/bin/barcode-server" "$0" "$@" | ||
CMD [ "run" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
__version__ = "2.3.3" | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[tool.poetry] | ||
name = "barcode-server" | ||
version = "2.3.3" | ||
description = "A simple daemon to expose USB Barcode Scanner data to other services using Websockets, Webhooks or MQTT." | ||
|
||
license = "AGPL-3.0-or-later" | ||
|
||
authors = [ | ||
"Markus Ressel <mail@markusressel.de>", | ||
] | ||
|
||
readme = 'README.md' | ||
|
||
repository = "https://github.com/markusressel/barcode-server" | ||
homepage = "https://github.com/markusressel/barcode-server" | ||
|
||
keywords = ['barcode', 'asyncio', 'qrcode', 'http', 'mqtt', 'server', 'websocket', 'websocket'] | ||
|
||
classifiers = [ | ||
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", | ||
"Programming Language :: Python :: 3 :: Only", | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
"Development Status :: 5 - Production/Stable" | ||
] | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" # Compatible python versions must be declared here | ||
|
||
container-app-conf = ">=5.0.0" | ||
evdev = "*" | ||
orjson = ">=3,<4" | ||
aiohttp = "*" | ||
asyncio-mqtt = "*" | ||
prometheus-client = "*" | ||
prometheus_async = "*" | ||
click = "*" | ||
|
||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = "*" | ||
pytest-aiohttp = "*" | ||
pytest-mock = "*" | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = [ | ||
"tests", | ||
] | ||
|
||
[tool.poetry.scripts] | ||
barcode-server = 'barcode_server.cli:cli' |