-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hwchase17/master
merge
- Loading branch information
Showing
741 changed files
with
55,025 additions
and
10,334 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.venv | ||
.github | ||
.git | ||
.mypy_cache | ||
.pytest_cache | ||
Dockerfile |
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
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
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,44 @@ | ||
# This is a Dockerfile for running unit tests | ||
|
||
# Use the Python base image | ||
FROM python:3.11.2-bullseye AS builder | ||
|
||
# Define the version of Poetry to install (default is 1.4.2) | ||
ARG POETRY_VERSION=1.4.2 | ||
|
||
# Define the directory to install Poetry to (default is /opt/poetry) | ||
ARG POETRY_HOME=/opt/poetry | ||
|
||
# Create a Python virtual environment for Poetry and install it | ||
RUN python3 -m venv ${POETRY_HOME} && \ | ||
$POETRY_HOME/bin/pip install --upgrade pip && \ | ||
$POETRY_HOME/bin/pip install poetry==${POETRY_VERSION} | ||
|
||
# Test if Poetry is installed in the expected path | ||
RUN echo "Poetry version:" && $POETRY_HOME/bin/poetry --version | ||
|
||
# Set the working directory for the app | ||
WORKDIR /app | ||
|
||
# Use a multi-stage build to install dependencies | ||
FROM builder AS dependencies | ||
|
||
# Copy only the dependency files for installation | ||
COPY pyproject.toml poetry.lock poetry.toml ./ | ||
|
||
# Install the Poetry dependencies (this layer will be cached as long as the dependencies don't change) | ||
RUN $POETRY_HOME/bin/poetry install --no-interaction --no-ansi | ||
|
||
# Use a multi-stage build to run tests | ||
FROM dependencies AS tests | ||
|
||
# Copy the rest of the app source code (this layer will be invalidated and rebuilt whenever the source code changes) | ||
COPY . . | ||
|
||
RUN /opt/poetry/bin/poetry install --no-interaction --no-ansi | ||
|
||
# Set the entrypoint to run tests using Poetry | ||
ENTRYPOINT ["/opt/poetry/bin/poetry", "run", "pytest"] | ||
|
||
# Set the default command to run all unit tests | ||
CMD ["tests/unit_tests"] |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.