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

Commit 3c0c2f6

Browse files
authored
Merge pull request #43 from juanjux/feature/allow_devdeps
Use a local copy of pydetector if it exists
2 parents 4dd607b + 26432c0 commit 3c0c2f6

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

Dockerfile.build.tpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ RUN mkdir -p /opt/driver/src && \
44
adduser $BUILD_USER -u $BUILD_UID -D -h /opt/driver/src
55

66
RUN apk add --no-cache --update python python-dev python3 python3-dev py-pip py2-pip git build-base bash
7-
RUN pip3 install pydetector-bblfsh==0.10.3 \
8-
git+https://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
7+
RUN pip3 install git+https://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
98

109
WORKDIR /opt/driver/src

Dockerfile.tpl

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +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

6-
RUN pip2 install pydetector-bblfsh==0.10.3
8+
RUN apk add --no-cache --update python python3 py-pip py2-pip git
79

810
ADD build /opt/driver/bin
911
ADD native/python_package /tmp/python_driver
1012
RUN pip3 install /tmp/python_driver
1113
RUN yes|rm -rf /tmp/python_driver
1214

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}
21+
1322
CMD /opt/driver/bin/driver

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
DEV_DEPS ?= native/dev_deps
2+
13
test-native-internal:
2-
cd native/python_package/test; \
4+
pip3 install --user ${DEV_DEPS}/python-pydetector/ || pip3 install --user pydetector-bblfsh
5+
pip3 install --user git+https://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang
6+
cd native/python_package/test && \
37
python3 -m unittest discover
48

59
build-native-internal:
6-
cd native/python_package/; \
10+
cd native/python_package/ && \
711
pip3 install -U --user .
812
cp native/sh/native.sh $(BUILD_PATH)/native;
913
chmod +x $(BUILD_PATH)/native

native/dev_deps/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
If a pydetector directory exists here, it will be installed to the driver
2+
container image instead of the one from PyPI. This way you can test pydetector
3+
features related to the driver without publishing new versions.
4+
5+
Note that Docker doesn't allow to `ADD` symlinks so the directory
6+
must be copied, not linked.

0 commit comments

Comments
 (0)