Sign inSign up

claranet/python-check

By claranet

•Updated almost 7 years ago

Image
0

244

claranet/python-check repository overview

⁠Claranet Python Check

Docker image for Continuous Integrations to check python scripts with code lint and format.

⁠What does it contains

The image is based on official alpine image and add some tools like :

  • python3
  • pyflakes
  • pycodestyle
  • pydocstyle
  • black

⁠Dockerfile

FROM alpine:latest

RUN apk add --no-cache \
		gcc \
		musl-dev \
		python3-dev \
        python3

RUN pip3 install --no-cache-dir --no-compile black && \
    pip3 install --no-cache-dir --no-compile pyflakes && \
    pip3 install --no-cache-dir --no-compile pycodestyle && \
    pip3 install --no-cache-dir --no-compile pydocstyle

RUN find /usr/lib/ -name '__pycache__' -print0 | xargs -0 -n1 rm -rf && \
    find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf;

ENTRYPOINT []
HEALTHCHECK NONE
CMD []

⁠How to build

Be sure docker service is run and :

docker build -t claranet/python-check .

⁠How to use

docker run --rm -v  $(pwd):/data claranet/python-check:latest black --verbose --check ./script.py
docker run --rm -v  $(pwd):/data claranet/python-check:latest pycodestyle ./script.py
docker run --rm -v  $(pwd):/data claranet/python-check:latest pydocstyle ./script.py
docker run --rm -v  $(pwd):/data claranet/python-check:latest pyflakes ./script.py

Tag summary

Content type

Image

Digest

Size

81.4 MB

Last updated

almost 7 years ago

docker pull claranet/python-check