Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

switch to poetry & black #77

Merged
merged 6 commits into from
Dec 23, 2019
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
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length=240
ignore=E722,W503
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ scm-source.json
*.bak
htmlcov/
.pytest_cache/
.mypy_cache
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
dist: xenial
dist: bionic
sudo: yes
language: python
python:
- "3.7"
services:
- docker
install:
- pip install pipenv
- pipenv install --dev
- pip install poetry
script:
- make test docker
after_success:
- coveralls
env:
PIPENV_IGNORE_VIRTUALENVS=1
22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
FROM python:3.7-alpine3.10
MAINTAINER Henning Jacobs <henning@jacobs1.de>
FROM python:3.8-slim

WORKDIR /

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
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_downscaler /kube_downscaler

ARG VERSION=dev

RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" /kube_downscaler/__init__.py

ENTRYPOINT ["python3", "-m", "kube_downscaler"]
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ TAG ?= $(VERSION)

default: docker

test:
pipenv run flake8
pipenv run coverage run --source=kube_downscaler -m py.test -v
pipenv run coverage report
.PHONY: install
install:
poetry install

test: install
poetry run flake8
poetry run black --check kube_downscaler
poetry run mypy --ignore-missing-imports kube_downscaler
poetry run coverage run --source=kube_downscaler -m py.test -v
poetry run coverage report

docker:
docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" .
Expand Down
18 changes: 0 additions & 18 deletions Pipfile

This file was deleted.

Loading