Skip to content

Commit 5e92b76

Browse files
committed
tidy pyenv
Signed-off-by: Chris Snow <[email protected]>
1 parent 21b84b7 commit 5e92b76

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND noninteractive
55
COPY requirements.txt /tmp
66

77
RUN apt-get update \
8-
&& apt-get install -y vim yarn sudo \
8+
&& apt-get install -y vim yarn sudo python3-sphinx \
99
&& apt-get install -y make build-essential libssl-dev zlib1g-dev \
1010
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
1111
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \
@@ -36,7 +36,7 @@ RUN /bin/bash -c " \
3636
&& git clone https://github.com/momo-lab/xxenv-latest.git ~/.pyenv/plugins/latest \
3737
"
3838

39-
RUN echo 'export PYENV_ROOT="~/.pyenv"' >> ~/.bashrc \
39+
RUN echo 'export PYENV_ROOT="/home/theia/.pyenv"' >> ~/.bashrc \
4040
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
4141
&& echo 'if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)"; fi' >> ~/.bashrc
4242

@@ -53,25 +53,25 @@ RUN export PATH=/home/theia/.pyenv/bin:$PATH; \
5353
&& pyenv local $(pyenv versions --bare) \
5454
&& pyenv versions
5555

56+
RUN echo "Installing python modules" \
57+
&& PY_PATHS=$(ls -1 /home/theia/.pyenv/versions/*/bin/python?.?) \
58+
&& for v in ${PY_PATHS}; do echo "******* ${v} *******"; ${v} -m pip install --upgrade pip setuptools wheel; done \
59+
&& for v in ${PY_PATHS}; do echo "******* ${v} *******"; ${v} -m pip install --upgrade tox tox-pyenv ipython pylint pytest mock nose flake8 flake8-docstrings autopep8; done \
60+
&& for v in ${PY_PATHS}; do ${v} -m pip install -r /tmp/requirements.txt; done
5661

5762
USER root
5863

5964
RUN echo "Installing python modules" \
60-
&& PY_PATHS=$(ls -1 /home/theia/.pyenv/versions/*/bin/python?.? && cat /home/theia/python3_path && cat /home/theia/python2_path) \
65+
&& PY_PATHS=$(cat /home/theia/python3_path && cat /home/theia/python2_path) \
6166
&& for v in ${PY_PATHS}; do echo "******* ${v} *******"; ${v} -m pip install --upgrade pip setuptools wheel; done \
6267
&& for v in ${PY_PATHS}; do echo "******* ${v} *******"; ${v} -m pip install --upgrade tox tox-pyenv ipython pylint pytest mock nose flake8 flake8-docstrings autopep8; done \
63-
&& /home/theia/.pyenv/versions/*/bin/python3.8 -m pip install -U black isort sphinx \
68+
&& for v in ${PY_PATHS}; do ${v} -m pip install -r /tmp/requirements.txt; done \
69+
&& /home/theia/.pyenv/versions/*/bin/python3.8 -m pip install -U black isort \
6470
&& ln -f -s /home/theia/.pyenv/versions/*/bin/black /bin/ \
65-
&& ln -f -s /home/theia/.pyenv/versions/*/bin/isort /bin/ \
66-
&& ln -f -s /home/theia/.pyenv/versions/*/bin/sphinx /bin/ \
67-
&& for v in ${PY_PATHS}; do ${v} -m pip install -r /tmp/requirements.txt; done
68-
69-
RUN chown -R theia:theia /home/theia
71+
&& ln -f -s /home/theia/.pyenv/versions/*/bin/isort /bin/
7072

7173
USER theia
7274
WORKDIR /home/theia
7375

74-
#RUN echo 'PATH=$PATH:/home/theia/.local/bin/' >> /home/theia/.bashrc
75-
7676
ENV PYTHONPATH=/home/project:$PYTHONPATH
7777

pre_push_verifications.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ black bin/ tests/ hpecp/
99
flake8 --docstring-convention numpy bin/ hpecp/
1010
flake8 --ignore=D,E501 tests/ # verify tests, but not for documentation
1111

12+
if [[ -d /home/theia/ ]];
13+
then
14+
# ensure pyenvs are available to tox
15+
eval "$(pyenv init -)"
16+
pyenv shell $(pyenv versions --bare)
17+
fi
18+
1219
tox -- tests/
1320

1421
# coverage causes some tests to fail on PY3 so test it (issues 93)
15-
#coverage3 erase && coverage3 run --source hpecp,bin setup.py test && coverage3 report -m
16-
17-
22+
#coverage3 erase && coverage3 run --source hpecp,bin setup.py test && coverage3 report -m

0 commit comments

Comments
 (0)