Skip to content

Commit 29b0396

Browse files
committed
fix: reminder
1 parent a881dea commit 29b0396

File tree

10 files changed

+2148
-163
lines changed

10 files changed

+2148
-163
lines changed

.github/actions/setup/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ inputs:
1616
poetry_version:
1717
description: Poetry version
1818
required: false
19-
default: 1.8.3
19+
default: 2.0.0
2020

2121
runs:
2222
using: composite

functions/download_service/Dockerfile.lambda

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LABEL language=python \
55
runtime=aws-lambda \
66
extras=poetry
77

8-
ARG LAMBDA_INSIGHTS_VERSION=1.0.229.0
98
ENV POETRY_VIRTUALENVS_CREATE=false
109
ENV PATH="/root/.local/bin:$PATH"
1110

@@ -16,14 +15,13 @@ WORKDIR /
1615

1716
# Install python poetry
1817
# Install Lambda Insights
19-
RUN curl -sSL https://install.python-poetry.org | python3 - \
20-
&& curl -O https://lambda-insights-extension.s3-ap-northeast-1.amazonaws.com/amazon_linux/lambda-insights-extension.${LAMBDA_INSIGHTS_VERSION}.rpm \
21-
&& rpm -U lambda-insights-extension.${LAMBDA_INSIGHTS_VERSION}.rpm \
22-
&& rm -f lambda-insights-extension.${LAMBDA_INSIGHTS_VERSION}.rpm
18+
RUN curl -sSL https://install.python-poetry.org | python3 -
2319

2420
# Copy the dependencies files to the Docker image
2521
COPY pyproject.toml poetry.lock /
2622

23+
RUN poetry self add poetry-plugin-export@latest
24+
2725
# Extract dependencies from poetry.lock and install them with pip
2826
RUN poetry export --format requirements.txt --without-hashes --output requirements.txt && \
2927
pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" --no-cache-dir --no-deps

functions/download_service/code/repos/download.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ async def remind(
134134
.group_by(Download.email, Download.name, Download.country_code)
135135
.having(
136136
func.sum(cast(Download.is_downloaded, Integer)) == 0,
137-
func.count() == 1,
138-
func.max(Download.expires_at) > dt.datetime.now(dt.UTC) + dt.timedelta(days=2),
137+
func.count() <= 2,
138+
func.max(Download.expires_at) < dt.datetime.now(dt.UTC),
139139
)
140140
)
141141

functions/download_service/poetry.lock

+950-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

functions/download_service/pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ description = "Download service API Handler"
55
authors = ["Andre Sionek <[email protected]>"]
66
package-mode = false
77

8+
[tool.poetry.requires-plugins]
9+
poetry-plugin-export = ">1.8"
10+
811
[tool.poetry.dependencies]
912
python = "^3.11"
1013
aws-lambda-powertools = {version = "^3.2.0", extras = ["tracer"]}
@@ -19,6 +22,7 @@ sqlmodel = "^0.0.22"
1922
alembic = "^1.14.0"
2023
sqlalchemy = "^2.0.32"
2124
asyncpg = "^0.29.0"
25+
poetry = "^2.0.0"
2226

2327
[tool.poetry.group.test]
2428
optional = true

functions/email_service/Dockerfile.lambda

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LABEL language=python \
55
runtime=aws-lambda \
66
extras=poetry
77

8-
ARG LAMBDA_INSIGHTS_VERSION=1.0.229.0
98
ENV POETRY_VIRTUALENVS_CREATE=false
109
ENV PATH="/root/.local/bin:$PATH"
1110

@@ -15,15 +14,13 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1514
WORKDIR /
1615

1716
# Install python poetry
18-
# Install Lambda Insights
19-
RUN curl -sSL https://install.python-poetry.org | python3 - \
20-
&& curl -O https://lambda-insights-extension.s3-ap-northeast-1.amazonaws.com/amazon_linux/lambda-insights-extension.${LAMBDA_INSIGHTS_VERSION}.rpm \
21-
&& rpm -U lambda-insights-extension.${LAMBDA_INSIGHTS_VERSION}.rpm \
22-
&& rm -f lambda-insights-extension.${LAMBDA_INSIGHTS_VERSION}.rpm
17+
RUN curl -sSL https://install.python-poetry.org | python3 -
2318

2419
# Copy the dependencies files to the Docker image
2520
COPY pyproject.toml poetry.lock /
2621

22+
RUN poetry self add poetry-plugin-export@latest
23+
2724
# Extract dependencies from poetry.lock and install them with pip
2825
RUN poetry export --format requirements.txt --without-hashes --output requirements.txt && \
2926
pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" --no-cache-dir --no-deps

0 commit comments

Comments
 (0)