From 6a71e9ab1d247887a397519ed39fbc58e680e411 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Sat, 18 May 2024 21:56:11 -0400 Subject: [PATCH 1/4] Add poetry for dependency management. Update python version. Using virtual environment in vscode. --- .gitignore | 1 + pyproject.toml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index 351e035..950b5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,7 @@ venv/ ENV/ env.bak/ venv.bak/ +poetry.lock # Spyder project settings .spyderproject diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a31b9fb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[tool.poetry] +name = "dakiny-bot" +version = "0.1.0" +description = "Dakiny's Discord Bot." +authors = ["imcompiling "] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" +gitpython = "3.1.43" +fastapi = "0.111.0" +hydra-core = "1.3.2" +nextcord = "2.4.2" +pandas = "1.5.2" +python-dotenv = "1.0.0" +pytz = "2022.7.1" +sqlalchemy = "1.4.46" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" From dea3f7cabf89c1a45e3540529f8a5a934a551da9 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Sat, 18 May 2024 22:29:18 -0400 Subject: [PATCH 2/4] Update dockerfile to use poetry for dependencies. Decided to just use poetry to just export requirements instead of building package. --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index be4ecdc..c76014d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,19 @@ -FROM python:3.10.6-slim +FROM python:3.11.9-slim # install dependencies RUN apt-get update && apt-get -y upgrade && apt-get -y install git -RUN pip install --upgrade pip - WORKDIR /home -COPY requirements.txt requirements.txt - COPY config.py config.py COPY main.py main.py COPY utils.py utils.py +COPY pyproject.toml pyproject.toml COPY classes classes/ COPY cogs cogs/ COPY database_setup database_setup/ -RUN pip install -r requirements.txt +RUN pip install --upgrade pip && pip install poetry && poetry export -f requirements.txt --output requirements.txt && pip install -r requirements.txt CMD ["python3", "-u", "./main.py"] \ No newline at end of file From 95ad47368c2dc71133f2362d1e06f0859c47b5e1 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Sat, 18 May 2024 22:34:13 -0400 Subject: [PATCH 3/4] Remove requirements.txt --- requirements.txt | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f46c5fd..0000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -GitPython==3.1.43 -fastapi==0.111.0 -hydra-core==1.3.2 -nextcord==2.4.2 -pandas==1.5.2 -python-dotenv==1.0.0 -pytz==2022.7.1 -sqlalchemy==1.4.46 \ No newline at end of file From eb1c87fbf420d77026555d7d7fbf4ffbaa508ed0 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Sat, 18 May 2024 22:38:57 -0400 Subject: [PATCH 4/4] install sqlite3 onto container. Using it a lot for debugging/fixes. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c76014d..0ea25a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.11.9-slim # install dependencies -RUN apt-get update && apt-get -y upgrade && apt-get -y install git +RUN apt-get update && apt-get -y upgrade && apt-get -y install git sqlite3 WORKDIR /home