Skip to content

Commit

Permalink
fix: Dockerfile version bump, tox version bump, tests - remove python2
Browse files Browse the repository at this point in the history
  • Loading branch information
lead4good committed May 9, 2020
1 parent 0016844 commit 34f763c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.dockerignore
Dockerfile
*.swp
*.pyc
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ python/package-lock.json
python/package.json
python/keys.json
python/LICENSE.txt
.env
.env
*.swp
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

# Supresses unwanted user interaction (like "Please select the geographic area" when installing tzdata)
ENV DEBIAN_FRONTEND=noninteractive

ADD . /ccxt
ADD ./ /ccxt
WORKDIR /ccxt

# Update packages (use us.archive.ubuntu.com instead of archive.ubuntu.com — solves the painfully slow apt-get update)
RUN sed -i 's/archive\.ubuntu\.com/us\.archive\.ubuntu\.com/' /etc/apt/sources.list \
&& apt-get update \
# Miscellaneous deps
&& apt-get -y install curl gnupg git pandoc \
&& apt-get install -y --no-install-recommends curl gnupg git pandoc ca-certificates \
# PHP
&& apt-get install -y php php-curl php-iconv php-mbstring php-bcmath \
&& apt-get install -y --no-install-recommends php php-curl php-iconv php-mbstring php-bcmath \
# Node
&& curl -sL https://deb.nodesource.com/setup_11.x | bash - \
&& apt-get -y install nodejs \
# Python 2
&& apt-get install -y python-pip \
&& pip2 install --upgrade setuptools \
&& pip2 install tox \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs \
# Python 3
&& apt-get install -y python3 python3-pip \
&& apt-get install -y --no-install-recommends python3 python3-pip \
&& pip3 install --upgrade setuptools \
&& pip3 install tox \
# Copy files to workdir to && install scripts against it (will be replaced with a live-mounted volume at startup)
Expand All @@ -33,7 +29,6 @@ RUN sed -i 's/archive\.ubuntu\.com/us\.archive\.ubuntu\.com/' /etc/apt/sources.l
&& echo "export NODE_PATH=/usr/lib/node_modules" >> $HOME/.bashrc \
&& cd python \
&& python3 setup.py develop \
&& python setup.py develop \
&& cd .. \
## Remove apt sources
&& apt-get -y autoremove && apt-get clean && apt-get autoclean \
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
'yarl==1.1.0',
],
'qa': [
'flake8==3.5.0'
'flake8==3.7.9'
],
'doc': [
'Sphinx==1.7.0'
Expand Down
2 changes: 1 addition & 1 deletion python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ commands =
[testenv:qa]
basepython = python3
changedir = {toxinidir}
commands = flake8 --exclude static_dependencies,.tox
commands = flake8 --extend-ignore=F841,W504 --exclude static_dependencies,.tox
deps = .[qa]

[testenv:doc]
Expand Down
16 changes: 7 additions & 9 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
A tests launcher. Runs tests for all languages and all exchanges, in
parallel, with a humanized error reporting.
Usage: node run-tests [--php] [--js] [--python] [--python2] [--python3] [exchange] [symbol]
Usage: node run-tests [--php] [--js] [--python] [--python-async] [exchange] [symbol]
--------------------------------------------------------------------------- */

Expand All @@ -26,9 +26,8 @@ const keys = {

'--js': false, // run JavaScript tests only
'--php': false, // run PHP tests only
'--python': false, // run Python tests only
'--python2': false, // run Python 2 tests only
'--python3': false, // run Python 3 tests only
'--python': false, // run Python 3 tests only
'--python-async': false, // run Python 3 async tests only
}

let exchanges = []
Expand Down Expand Up @@ -150,11 +149,10 @@ const testExchange = async (exchange) => {
const args = [exchange, ...symbol === 'all' ? [] : symbol]
, allTests = [

{ language: 'JavaScript', key: '--js', exec: ['node', 'js/test/test.js', ...args] },
{ language: 'Python', key: '--python', exec: ['python', 'python/test/test.py', ...args] },
{ language: 'Python 2', key: '--python2', exec: ['python2', 'python/test/test.py', ...args] },
{ language: 'Python 3', key: '--python3', exec: ['python3', 'python/test/test_async.py', ...args] },
{ language: 'PHP', key: '--php', exec: ['php', '-f', 'php/test/test.php', ...args] }
{ language: 'JavaScript', key: '--js', exec: ['node', 'js/test/test.js', ...args] },
{ language: 'Python 3', key: '--python', exec: ['python3', 'python/test/test.py', ...args] },
{ language: 'Python 3 Async', key: '--python-async', exec: ['python3', 'python/test/test_async.py', ...args] },
{ language: 'PHP', key: '--php', exec: ['php', '-f', 'php/test/test.php', ...args] }
]
, selectedTests = allTests.filter (t => keys[t.key])
, scheduledTests = selectedTests.length ? selectedTests : allTests
Expand Down

0 comments on commit 34f763c

Please sign in to comment.