Skip to content

Commit 32344bb

Browse files
authored
Remove requirements.txt (#62)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Simplified the CI/CD pipeline by removing the `verify-requirements` job and associated steps. - Streamlined the development setup by removing the `poetry-export` hook from pre-commit configuration. - **Refactor** - Improved Dockerfile structure for better clarity and efficiency in managing dependencies. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a577588 commit 32344bb

File tree

4 files changed

+12
-726
lines changed

4 files changed

+12
-726
lines changed

.circleci/config.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ jobs:
3434
- run: poetry run black . --check
3535
- run: poetry run pylint src
3636
- run: poetry run mypy -p src
37-
verify-requirements:
38-
executor: python
39-
steps:
40-
- checkout
41-
- python/install-packages:
42-
pkg-manager: poetry
43-
- run: poetry export -o requirements.txt
44-
- run: git diff --exit-code
4537
github_release:
4638
docker:
4739
- image: cimg/base:stable
@@ -73,8 +65,6 @@ workflows:
7365
name: Lint
7466
- coverage:
7567
name: Coverage
76-
- verify-requirements:
77-
name: Verify requirements.txt
7868
- python/test:
7969
name: Unit tests
8070
pkg-manager: poetry

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ repos:
44
hooks:
55
- id: poetry-check
66
- id: poetry-lock
7-
- id: poetry-export
8-
args: [ "-o", "requirements.txt" ]
97
- repo: https://github.com/pycqa/isort
108
rev: '5.13.2'
119
hooks:

Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM python:3.12 AS builder
1+
FROM python:3.12 AS builder-base
22

3-
WORKDIR /builder
3+
WORKDIR /app
44
# python
55
ENV PYTHONUNBUFFERED=1 \
66
# prevents python creating .pyc files
@@ -10,16 +10,22 @@ ENV PYTHONUNBUFFERED=1 \
1010
PIP_NO_CACHE_DIR=off \
1111
PIP_DISABLE_PIP_VERSION_CHECK=on
1212

13-
COPY ./requirements.txt ./
13+
FROM builder-base AS lock
1414

15+
RUN pip install --no-cache-dir poetry==1.8.2
16+
COPY ./pyproject.toml ./poetry.lock ./
17+
RUN poetry export --output requirements.txt
18+
19+
FROM builder-base AS builder
20+
21+
COPY --from=lock /app/requirements.txt ./
1522
RUN pip wheel --no-cache-dir --no-deps --wheel-dir ./wheels -r requirements.txt
1623

1724
FROM python:3.12-slim AS app
1825

1926
RUN adduser --system --group --home /home/nonroot nonroot
2027
ENV PATH="/home/nonroot/.local/bin:${PATH}"
2128
USER nonroot:nonroot
22-
2329
WORKDIR /home/nonroot/app
2430

2531
# python
@@ -31,8 +37,8 @@ ENV PYTHONUNBUFFERED=1 \
3137
PIP_NO_CACHE_DIR=off \
3238
PIP_DISABLE_PIP_VERSION_CHECK=on
3339

34-
COPY --from=builder /builder/wheels ./wheels
35-
COPY --from=builder /builder/requirements.txt ./
40+
COPY --from=builder /app/wheels ./wheels
41+
COPY --from=builder /app/requirements.txt ./
3642

3743
RUN pip install --no-cache-dir ./wheels/*
3844

0 commit comments

Comments
 (0)