Skip to content

Commit

Permalink
Fix docker file, add test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Sep 3, 2020
1 parent 6a34b64 commit a935c17
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
ARG VERSION=3
FROM python:$VERSION

RUN mkdir /isort
WORKDIR /isort
# Install pip and poetry
RUN python -m pip install --upgrade pip && python -m pip install poetry

# Setup as minimal a stub project as posible, simply to allow caching base dependencies
# between builds.
#
# If error is encountered in these steps, can safely be removed locally.
RUN mkdir -p /isort/isort
RUN mkdir -p /isort/tests
RUN touch /isort/isort/__init__.py
RUN touch /isort/tests/__init__.py
RUN touch /isort/README.md
WORKDIR /isort
COPY pyproject.toml poetry.lock /isort/
RUN python -m pip install --upgrade pip && python -m pip install poetry && poetry install
RUN poetry install

COPY . /isort/
# Install latest code for actual project
RUN rm -rf /isort
COPY . /isort
RUN poetry install

# Run full test suite
CMD /isort/scripts/test.sh

0 comments on commit a935c17

Please sign in to comment.