Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test setup of text_normalization component #369

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions components/text_normalization/Dockerfile
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"]
1 change: 1 addition & 0 deletions components/text_normalization/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==7.4.0