Skip to content

Commit 0809ff9

Browse files
authored
Merge pull request #237 from hpe-container-platform-community/update_theia_ide
Update theia ide
2 parents be471c6 + 25cda3d commit 0809ff9

14 files changed

+60
-46
lines changed

Dockerfile

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,41 @@ FROM theiaide/theia-full:next
33
COPY requirements.txt /tmp
44

55
RUN sudo apt-get update \
6-
&& sudo apt-get install -y software-properties-common \
7-
&& sudo add-apt-repository -y ppa:deadsnakes/ppa \
8-
&& sudo apt-get update \
9-
&& sudo apt-get install -y python3.5 python3.6 python3.7 python3.8 python3.9 tox python3-sphinx python-pip python3-pip python3.9-distutils vim
6+
# && sudo apt-get install -y software-properties-common \
7+
# && sudo add-apt-repository -y ppa:deadsnakes/ppa \
8+
&& sudo apt-get remove --purge -y python \
9+
&& sudo apt-get install -y python-pip python3-pip python3-sphinx vim
10+
# && sudo apt-get install -y python3.5 python3.6 python3.7 python3.8 python3.9 python3.9-distutils
11+
12+
RUN sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
13+
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
14+
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \
15+
&& git clone https://github.com/pyenv/pyenv.git /home/theia/.pyenv \
16+
&& git clone https://github.com/momo-lab/xxenv-latest.git /home/theia/.pyenv/plugins/xxenv-latest \
17+
&& echo 'export PYENV_ROOT="/home/theia/.pyenv"' >> /home/theia/.bashrc \
18+
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> /home/theia/.bashrc \
19+
&& echo 'if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)"; fi' >> /home/theia/.bashrc
20+
21+
RUN /home/theia/.pyenv/bin/pyenv latest install 2.7 \
22+
&& /home/theia/.pyenv/bin/pyenv latest install 3.5 \
23+
&& /home/theia/.pyenv/bin/pyenv latest install 3.6 \
24+
&& /home/theia/.pyenv/bin/pyenv latest install 3.7 \
25+
&& /home/theia/.pyenv/bin/pyenv latest install 3.8 \
26+
&& /home/theia/.pyenv/bin/pyenv install 3.9-dev \
27+
&& /home/theia/.pyenv/bin/pyenv local $(/home/theia/.pyenv/bin/pyenv versions --bare) \
28+
&& /home/theia/.pyenv/bin/pyenv versions
1029

11-
# FIXME: Python 3.9 returns errors with pip
1230
RUN echo "Installing python modules" \
13-
&& for v in 2 3 3.5 3.6 3.7 3.8; do python${v} -m pip install -U ipython pylint pytest mock nose flake8-docstrings flake8-per-file-ignores==0.8.1 isort; done \
14-
&& for v in 3 3.5 3.6 3.7 3.8; do python${v} -m pip install -U black; done \
15-
&& sudo ln -s /home/theia/.local/bin//black /bin/ \
16-
&& for v in 2 3 3.5 3.6 3.7 3.8; do python${v} -m pip install -r /tmp/requirements.txt; done
31+
&& PYENV_PATHS=$(ls -1 /home/theia/.pyenv/versions/*/bin/python?.?) \
32+
&& PYENV_3PATHS=$(ls -1 /home/theia/.pyenv/versions/*/bin/python3.?) \
33+
&& for v in ${PYENV_PATHS}; do ${v} -m pip install --upgrade pip; done \
34+
&& for v in ${PYENV_PATHS}; do ${v} -m pip install -U tox tox-pyenv ipython pylint pytest mock nose flake8-docstrings; done \
35+
&& /home/theia/.pyenv/versions/*/bin/python3.8 -m pip install -U black isort \
36+
&& sudo ln -f -s /home/theia/.pyenv/versions/*/bin/black /bin/ \
37+
&& sudo ln -f -s /home/theia/.pyenv/versions/*/bin/isort /bin/ \
38+
&& for v in ${PYENV_PATHS}; do ${v} -m pip install -r /tmp/requirements.txt; done
1739

1840
RUN echo 'PATH=$PATH:/home/theia/.local/bin/' >> /home/theia/.bashrc
1941

2042
ENV PYTHONPATH=/home/project:$PYTHONPATH
43+

pre_push_verifications.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22

33
set -e
44

5-
isort tests/*.py
6-
isort hpecp/**.py
7-
isort bin/*.py
8-
5+
isort tests/*.py hpecp/**.py bin/*.py
96
black bin/ tests/ hpecp/
107

118
#flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
129
flake8 --docstring-convention numpy bin/ hpecp/
1310

14-
flake8 --ignore=D,E501 tests/cli_test.py # don't verify documentation in tests
11+
flake8 --ignore=D,E501 tests/ # verify tests, but not for documentation
12+
13+
if [[ -d /home/theia/ ]];
14+
then
15+
# ensure pyenvs are available to tox
16+
eval "$(pyenv init -)"
17+
pyenv shell $(/home/theia/.pyenv/bin/pyenv versions --bare)
18+
tox --recreate --tox-pyenv-no-fallback -- tests/
19+
else
20+
tox -- tests/
21+
fi
1522

16-
tox -e py35 -- tests/
1723

18-
echo "********** FIXME: tox should test py27 as well **********"
24+
echo "********** FIXME: 'tox -e py27' is broken **********"
1925

2026
# coverage causes some tests to fail on PY3 so test it (issues 93)
2127
#coverage3 erase && coverage3 run --source hpecp,bin setup.py test && coverage3 report -m

tests/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ def registerHttpDeleteHandler(cls, url, response):
171171
@classmethod
172172
def setUpClass(cls):
173173

174-
_http_get_handlers = {}
175-
_http_post_handlers = {}
176-
_http_put_handlers = {}
177-
_http_delete_handlers = {}
174+
_http_get_handlers = {} # noqa: F841
175+
_http_post_handlers = {} # noqa: F841
176+
_http_put_handlers = {} # noqa: F841
177+
_http_delete_handlers = {} # noqa: F841
178178

179179
# Register the login handler
180180
BaseTestCase.registerHttpPostHandler(

tests/cli_mock_api_responses.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
# OTHER DEALINGS IN THE SOFTWARE.
2020

2121

22-
from hpecp.exceptions import APIItemNotFoundException
23-
2422
from .base import BaseTestCase, MockResponse
2523

2624

tests/client_mock_api_responses.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
# OTHER DEALINGS IN THE SOFTWARE.
2020

2121

22-
from hpecp.exceptions import APIItemNotFoundException
23-
2422
from .base import BaseTestCase, MockResponse
2523

2624

tests/config_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@
1818
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1919
# OTHER DEALINGS IN THE SOFTWARE.
2020

21-
from unittest import TestCase
22-
23-
import requests
2421
from mock import patch
2522

2623
from hpecp import ContainerPlatformClient
2724

28-
from .base import BaseTestCase, MockResponse
25+
from .base import BaseTestCase
2926
from .config_mock_api_responses import mockApiSetup
3027

3128
# setup the mock data

tests/gateway_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919
# OTHER DEALINGS IN THE SOFTWARE.
2020

2121
import tempfile
22-
from unittest import TestCase
2322

24-
import requests
2523
from mock import patch
2624

27-
from hpecp import APIItemNotFoundException, ContainerPlatformClient
25+
from hpecp import APIItemNotFoundException
2826
from hpecp.exceptions import APIItemConflictException
2927
from hpecp.gateway import GatewayController, GatewayStatus
3028

tests/k8s_worker_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from hpecp.exceptions import APIItemConflictException, APIItemNotFoundException
88
from hpecp.k8s_worker import K8sWorkerController, WorkerK8s, WorkerK8sStatus
99

10-
from .base import BaseTestCase, MockResponse, get_client
10+
from .base import BaseTestCase, get_client
1111
from .k8s_worker_mock_api_responses import mockApiSetup
1212

1313
# setup the mock data

tests/license_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import six
2525
from mock import patch
2626

27-
from .base import BaseTestCase, MockResponse
27+
from .base import BaseTestCase
2828
from .license_mock_api_responses import mockApiSetup
2929

3030
# setup the mock data

tests/role_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@
2121
import json
2222
from unittest import TestCase
2323

24-
import requests
2524
import six
2625
from mock import patch
2726

28-
from hpecp import ContainerPlatformClient
29-
30-
from .base import BaseTestCase, MockResponse, get_client
27+
from .base import BaseTestCase, get_client
3128
from .role_mock_api_responses import mockApiSetup
3229

3330
# setup the mock data

0 commit comments

Comments
 (0)