Allow running cpychecker on Py3

Also add explicit sha version to check out when new commits added.
This commit is contained in:
Daniele Varrazzo 2019-02-05 10:16:21 +00:00
parent f9cec90912
commit 59e1c368ad

View File

@ -1,4 +1,4 @@
# docker build -f scripts/cpychecker.Dockerfile -t cpychecker scripts/
# docker build -f scripts/cpychecker.Dockerfile --build-arg PYTHON=python2.7 -t cpychecker scripts/
# docker run --rm -ti --name cpychecker --volume `pwd`:/psycopg2 cpychecker
FROM ubuntu:18.04
@ -18,19 +18,29 @@ RUN apt-get update && \
python-six \
python2.7 \
python2.7-dev \
python3-lxml \
python3-pygments \
python3-setuptools \
python3-six \
python3.6 \
python3.6-dev \
&& rm -rf /var/lib/apt/lists/*
RUN git clone -b psycopg2 https://github.com/dvarrazzo/gcc-python-plugin.git
WORKDIR /gcc-python-plugin
ENV PYTHON=python2.7
ENV PYTHON_CONFIG=python2.7-config
RUN git fetch origin 08d0e644cadd0e6e2d2008ee286e2ea05326148c
RUN git reset --hard FETCH_HEAD
ARG PYTHON
ENV PYTHON=$PYTHON
ENV CC=gcc-6
RUN make PYTHON_CONFIG=$PYTHON_CONFIG plugin
RUN make PYTHON="$PYTHON" PYTHON_CONFIG="$PYTHON-config" plugin
# expected to be mounted
WORKDIR /psycopg2
ENV CC_FOR_CPYCHECKER=$CC
ENV CC=/gcc-python-plugin/gcc-with-cpychecker
CMD ["python2.7", "setup.py", "build"]
CMD $PYTHON setup.py build
# CMD ["sleep", "infinity"]