summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: e2c0d007344faf569c868b551c880b065732b20b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
ARG VERSION=3
FROM python:$VERSION

# Install pip and poetry
RUN python -m pip install --upgrade pip && python -m pip install poetry

# Setup as minimal a stub project as possible, 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 poetry install

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

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