Skip to content

Commit

Permalink
add dev dependencies via poetry
Browse files Browse the repository at this point in the history
and reworked base node dockerfile to use poetry
  • Loading branch information
rodja committed Aug 20, 2023
1 parent d5c634c commit 778d71e
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 42 deletions.
22 changes: 13 additions & 9 deletions base_node.dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
FROM zauberzeug/nicegui:1.2.13

RUN apt-get update && \
apt-get install -y jpeginfo \
apt-get install -y \
jpeginfo \
python3-pip \
libjpeg-dev \
curl \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /app/

RUN python3 -m pip install --upgrade pip

# Install system packages required by Pillow
# TODO upgrade to pillow >=10 in pyproject.toml
RUN apt-get update && \
apt-get install -y \
libjpeg-dev\
&& rm -rf /var/lib/apt/lists/*
# We use Poetry for dependency management
RUN curl -sSL https://install.python-poetry.org | python3 - && \
cd /usr/local/bin && \
ln -s ~/.local/bin/poetry && \
poetry config virtualenvs.create false

COPY pyproject.toml ./

RUN python3 -m pip install --no-cache-dir "uvicorn[standard]" tqdm async_generator aiofiles retry debugpy pytest-asyncio psutil icecream pytest "pytest-mock==3.6.1" autopep8 pynvml
RUN python3 -m pip install --no-cache-dir "learning-loop-node==0.7.53rc2"
# Allow installing dev dependencies to run tests
ARG INSTALL_DEV=true
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install -vvv --no-root ; else poetry install -vvv --no-root --no-dev ; fi"

# while development this will be mounted but in deployment we need the latest code baked into the image
ADD ./learning_loop_node /usr/local/lib/python3.11/site-packages/learning_loop_node
142 changes: 112 additions & 30 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ pytest-mock = "3.6.1"
pynvml = "^11.4.1"
aiohttp = "^3.8.4"

[tool.poetry.dev-dependencies]
pytest = "^6.2.1"
pytest-asyncio = "^0.19.0"
[tool.poetry.group.dev.dependencies]
pytest-flakefinder = "^1.1.0"
retry = "^0.9.2"
debugpy = "^1.6.7.post1"
pytest-asyncio = "^0.21.1"
autopep8 = "^2.0.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 778d71e

Please sign in to comment.