/
Dockerfile.testenv
39 lines (35 loc) · 1.31 KB
/
Dockerfile.testenv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM python:3
# As this is no image meant for distribution and production,
# redundancies are no flaw.
COPY vendor /var/cache/pip/
# Don't go with any existing pylintrc, for host images could change.
# Set a referrer to give a hint who to contact on misbehaving CIs.
RUN if [ ! -s /var/cache/pip/pylintrc ]; then \
curl --fail --location --silent --show-error \
--referer "https://github.com/wmark/thot" \
"https://google.github.io/styleguide/pylintrc" \
| sed -e "/^indent-string=/s@ @ @" \
>/var/cache/pip/pylintrc; \
fi \
&& cp -a /var/cache/pip/pylintrc /etc/pylintrc
COPY setup.py README.rst /usr/src/thot/
COPY src /usr/src/thot/src
RUN if [ -s /var/cache/pip/requirements.txt ]; then \
pip --disable-pip-version-check \
--cache-dir /var/cache/pip \
install \
--no-index --find-links /var/cache/pip \
pylint \
"/usr/src/thot[jinja,code]"; \
else \
pip --disable-pip-version-check \
--cache-dir /var/cache/pip \
install \
pylint \
"/usr/src/thot[jinja,code]"; \
pip freeze --exclude thot >/var/cache/pip/requirements.txt; \
pip --disable-pip-version-check \
--cache-dir /var/cache/pip \
wheel --wheel-dir /var/cache/pip \
-r /var/cache/pip/requirements.txt; \
fi