Skip to content

Commit a118485

Browse files
replace pip with poetry
1 parent 865a5eb commit a118485

File tree

5 files changed

+17
-28
lines changed

5 files changed

+17
-28
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
FROM mcr.microsoft.com/devcontainers/python:3.11-bookworm
22

3-
COPY ./app/requirements.txt /app/requirements.txt
4-
RUN pip install --no-cache-dir -r app/requirements.txt
3+
RUN pip install --no-cache-dir poetry
4+
COPY ./app/pyproject.toml /app/pyproject.toml
5+
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi
56

67
COPY ./app /app
8+

.github/workflows/deploy.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
uses: actions/setup-python@v5
1919
with:
2020
python-version: '3.11'
21+
22+
- name: Install poetry
23+
run: pipx install poetry
24+
2125
- name: Checkout Repo
2226
uses: actions/checkout@v4
2327

@@ -35,15 +39,15 @@ jobs:
3539
role-duration-seconds: 1200
3640
role-to-assume: arn:aws:iam::407839483216:role/admin
3741

38-
- name: Set up cache for pip dependencies
42+
- name: Set up cache for Poetry dependencies
3943
uses: actions/cache@v4
4044
with:
41-
path: ~/.cache/pip
42-
key: ${{ runner.os }}-pip-${{ hashFiles('app/requirements.txt') }}
45+
path: ~/.cache/pypoetry
46+
key: poetry-${{ hashFiles('app/poetry.lock') }}
4347

44-
- name: Install Python dependencies
48+
- name: Install Python dependencies with Poetry
4549
working-directory: ./app
46-
run: pip install -r requirements.txt
50+
run: poetry install --no-interaction --no-root
4751

4852
- name: Update knowledge_base.json
4953
working-directory: ./app

app/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
2525
apt-get install -y nodejs
2626

2727
# Install uWSGI and GitPython
28-
RUN pip install uwsgi gitpython
28+
RUN pip install --no-cache-dir poetry uwsgi gitpython
2929

30-
# Copy the requirements file first to leverage Docker's cache
31-
COPY requirements.txt /app/
32-
33-
# Install Python dependencies
34-
RUN pip install --no-cache-dir -r requirements.txt
30+
# Copy poetry files
31+
COPY pyproject.toml poetry.lock* ./
32+
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root
3533

3634
# Copy the application source code into the container
3735
COPY . /app

app/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ description = ""
55
authors = [
66
{name = "Defang Devs",email = "[email protected]"}
77
]
8-
readme = "README.md"
98
requires-python = ">=3.11,<4.0"
109
dependencies = [
1110
"flask (==2.0.1)",

app/requirements.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)