-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test setup of text_normalization component (#369)
This PR aligns the test setup of the `text_normalization` component with the one of the `download_images` component introduced in #354
- Loading branch information
1 parent
bd21e5a
commit edadd15
Showing
2 changed files
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
FROM --platform=linux/amd64 python:3.8-slim as base | ||
|
||
## System dependencies | ||
# System dependencies | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install git -y | ||
|
||
RUN pip3 install fondant[aws,azure,gcp]@git+https://github.com/mrchtr/fondant | ||
|
||
# install requirements | ||
# Install requirements | ||
COPY requirements.txt / | ||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
|
||
# Copy over src-files | ||
# Install Fondant | ||
# This is split from other requirements to leverage caching | ||
ARG FONDANT_VERSION=main | ||
RUN pip3 install fondant[aws,azure,gcp]@git+https://github.com/ml6team/fondant@${FONDANT_VERSION} | ||
|
||
# Set the working directory to the component folder | ||
WORKDIR /component | ||
COPY src/ src/ | ||
ENV PYTHONPATH "${PYTHONPATH}:./src" | ||
|
||
# Run component tests | ||
FROM base as test | ||
RUN pip3 install pytest # TODO add pytest to package setup | ||
ENV PYTHONPATH "${PYTHONPATH}:./src" | ||
COPY test_requirements.txt . | ||
RUN pip3 install --no-cache-dir -r test_requirements.txt | ||
COPY tests/ tests/ | ||
RUN ["python", "-m", "pytest", "tests/"] | ||
RUN python -m pytest tests | ||
|
||
FROM base | ||
# Set the working directory to the component folder | ||
WORKDIR /src | ||
ENTRYPOINT ["python", "main.py"] | ||
WORKDIR /component/src | ||
ENTRYPOINT ["python", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest==7.4.0 |