Switch to Poetry and Black (#254)

* Pipenv -> Poetry

* poetry and black
This commit is contained in:
Henning Jacobs
2019-12-23 20:07:46 +01:00
committed by GitHub
parent 578b03d214
commit d8b94db671
22 changed files with 1575 additions and 959 deletions

View File

@@ -1,27 +1,30 @@
FROM python:3.7-alpine3.10
FROM python:3.8-slim
WORKDIR /
RUN apk add --no-cache python3 python3-dev gcc musl-dev zlib-dev libffi-dev openssl-dev ca-certificates
RUN apt-get update && apt-get install --yes gcc
COPY Pipfile.lock /
COPY pipenv-install.py /
RUN pip3 install poetry
RUN /pipenv-install.py && \
rm -fr /usr/local/lib/python3.7/site-packages/pip && \
rm -fr /usr/local/lib/python3.7/site-packages/setuptools && \
apk del python3-dev gcc musl-dev zlib-dev libffi-dev openssl-dev && \
rm -rf /var/cache/apk/* /root/.cache /tmp/*
COPY poetry.lock /
COPY pyproject.toml /
FROM python:3.7-alpine3.10
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-dev --no-ansi
FROM python:3.8-slim
WORKDIR /
COPY --from=0 /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/site-packages
# copy pre-built packages to this image
COPY --from=0 /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
# now copy the actual code we will execute (poetry install above was just for dependencies)
COPY kube_ops_view /kube_ops_view
ARG VERSION=dev
RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" /kube_ops_view/__init__.py
ENTRYPOINT ["/usr/local/bin/python", "-m", "kube_ops_view"]
ENTRYPOINT ["python3", "-m", "kube_ops_view"]