From 44f4c811c56f26b48a46557ba8981c56c6e312b3 Mon Sep 17 00:00:00 2001 From: Kyle Cancio Date: Tue, 1 Sep 2026 00:44:48 +0800 Subject: [PATCH 1/2] chore: update poetry.toml and dockerfile --- Dockerfile | 49 +++++++++++++++++++++---------------------------- pyproject.toml | 9 ++++++--- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/Dockerfile b/Dockerfile index e271072..c1308fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,39 +1,32 @@ FROM python:3.10-slim -ARG token - -# necessary env vars for poetry to work properly -ENV token=$token \ - PYTHONUNBUFFERED=1 \ - PYTHONFAULTHANDLER=1 \ - PYTHONHASHSEED=random \ - PIP_NO_CACHE_DIR=off \ - PIP_DISABLE_PIP_VERSION_CHECK=on \ - PIP_DEFAULT_TIMEOUT=100 \ - POETRY_VERSION=1.3.2 - -# Install Poetry 1.3.2 via pip -RUN pip install -U pip \ - && apt-get update \ - && apt-get install gcc -y \ - && apt install -y libpq-dev python3-dev \ - && pip install "poetry==1.3.2" \ - && pip install setuptools>=65.5.1 -ENV PATH="${PATH}:/root/.poetry/bin" +# Build-time dependencies for C extensions (e.g. psycopg2, Levenshtein) +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc \ + libpq-dev \ + python3-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install modern Pip and Poetry into an isolated CLI location +RUN pip install --no-cache-dir -U pip setuptools \ + && pip install --no-cache-dir "poetry>=1.8.0" WORKDIR /progphil-bot +# Leverage Docker layer caching: copy lockfiles first COPY pyproject.toml poetry.lock ./ + +# Install project dependencies into Poetry's virtual environment +RUN poetry install --no-root --without dev + +# Copy project source code after dependencies are installed +COPY README.md ./ COPY src ./src COPY migrations ./migrations COPY config ./config -COPY README.md ./ - -# Install Poetry dependencies -RUN poetry config virtualenvs.create false \ - && poetry install --no-dev -COPY . . +# Install the root project package itself +RUN poetry install --without dev -# Run the bot -CMD ["poetry", "run", "progphil"] +# Run application using Poetry's virtual environment executable directly +CMD ["poetry", "run", "progphil"] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index cfab7fb..435ae70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,11 +13,11 @@ packages = [ [tool.poetry.dependencies] python = "^3.10.14" +charset-normalizer = "^3.3.2" # <-- ADD THIS python-dotenv = "^1.0.1" pyyaml = "^6.0" -flake8 = "^7.1.0" asyncpg = "^0.29.0" -requests = "^2.28.2" +requests = "^2.32.0" # <-- BUMP THIS (was 2.28.2) yoyo-migrations = "^8.2.0" cloudscraper = "^1.2.69" bs4 = "^0.0.2" @@ -29,9 +29,12 @@ pydantic = "^2.8.0" python-dateutil = "^2.9.0" discord-py = "^2.5.2" +[tool.poetry.group.dev.dependencies] # <-- MOVE DEV TOOLS HERE +flake8 = "^7.1.0" + [tool.poetry.scripts] progphil = "main:run" [build-system] requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +build-backend = "poetry.core.masonry.api" \ No newline at end of file From 377139637bbbfc7488868e89afe01ba338261916 Mon Sep 17 00:00:00 2001 From: Kyle Cancio Date: Tue, 1 Sep 2026 01:38:09 +0800 Subject: [PATCH 2/2] chore: update lock file --- poetry.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 17a7cf2..73864c5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.4.2 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -684,7 +684,7 @@ version = "7.1.0" description = "the modular source code checker: pep8 pyflakes and co" optional = false python-versions = ">=3.8.1" -groups = ["main"] +groups = ["dev"] files = [ {file = "flake8-7.1.0-py2.py3-none-any.whl", hash = "sha256:2e416edcc62471a64cea09353f4e7bdba32aeb079b6e360554c659a122b1bc6a"}, {file = "flake8-7.1.0.tar.gz", hash = "sha256:48a07b626b55236e0fb4784ee69a465fbf59d79eec1f5b4785c3d3bc57d17aa5"}, @@ -950,7 +950,7 @@ version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" -groups = ["main"] +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -1263,7 +1263,7 @@ version = "2.12.0" description = "Python style guide checker" optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["dev"] files = [ {file = "pycodestyle-2.12.0-py2.py3-none-any.whl", hash = "sha256:949a39f6b86c3e1515ba1787c2022131d165a8ad271b11370a8819aa070269e4"}, {file = "pycodestyle-2.12.0.tar.gz", hash = "sha256:442f950141b4f43df752dd303511ffded3a04c2b6fb7f65980574f0c31e6e79c"}, @@ -1413,7 +1413,7 @@ version = "3.2.0" description = "passive checker of Python programs" optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["dev"] files = [ {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, @@ -1949,4 +1949,4 @@ test = ["big-O", "importlib-resources ; python_version < \"3.9\"", "jaraco.funct [metadata] lock-version = "2.1" python-versions = "^3.10.14" -content-hash = "739dabcb3e829c460dfe532519aa9a55ec85aacfa3cfbef8d13d21131008601f" +content-hash = "e5342165585ddb5aaebd1f3de1ae7a1823c57fef2d61dfd3fc28d7638e78fad8"