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

Commit 26432c0

Browse files
author
Juanjo Alvarez
committed
Use docker and makefile variables for the dev_deps
Signed-off-by: Juanjo Alvarez <[email protected]>
1 parent 86abd34 commit 26432c0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Dockerfile.tpl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
FROM alpine:3.6
22
MAINTAINER source{d}
33

4-
RUN apk add --no-cache --update python python3 py-pip py2-pip git
4+
ARG DEVDEPS=native/dev_deps
5+
ARG CONTAINER_DEVDEPS=/tmp/dev_deps
6+
ARG PYDETECTOR_VER=0.10.3
57

8+
RUN apk add --no-cache --update python python3 py-pip py2-pip git
69

710
ADD build /opt/driver/bin
811
ADD native/python_package /tmp/python_driver
912
RUN pip3 install /tmp/python_driver
1013
RUN yes|rm -rf /tmp/python_driver
1114

12-
ADD native/dev_deps /tmp/dev_deps
13-
RUN pip2 install -U /tmp/dev_deps/python-pydetector || pip2 install pydetector-bblfsh==0.10.3
14-
RUN pip3 install -U /tmp/dev_deps/python-pydetector || pip3 install pydetector-bblfsh==0.10.3
15-
RUN yes|rm -rf /tmp/dev_deps
15+
ADD ${DEVDEPS} ${CONTAINER_DEVDEPS}
16+
ENV ENV_DEVDEPS=${DEVDEPS}
17+
ENV ENV_PYDETECTOR_VER=${PYDETECTOR_VER}
18+
RUN pip2 install -U ${CONTAINER_DEVDEPS}/python-pydetector || pip2 install pydetector-bblfsh==${PYDETECTOR_VER}
19+
RUN pip3 install -U ${CONTAINER_DEVDEPS}/python-pydetector || pip3 install pydetector-bblfsh==${PYDETECTOR_VER}
20+
RUN yes|rm -rf ${CONTAINER_DEVDEPS}
1621

1722
CMD /opt/driver/bin/driver

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
DEV_DEPS ?= native/dev_deps
2+
13
test-native-internal:
2-
pip3 install --user native/dev_deps/python-pydetector/ || pip3 install --user pydetector-bblfsh
4+
pip3 install --user ${DEV_DEPS}/python-pydetector/ || pip3 install --user pydetector-bblfsh
35
pip3 install --user git+https://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
46
cd native/python_package/test && \
57
python3 -m unittest discover

0 commit comments

Comments
 (0)