Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 78967dd

Browse files
committed
add python3 back
1 parent 4c3bc2c commit 78967dd

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ python:
33
- "2.7"
44

55
before_install:
6-
- sudo apt-get install -y python-setuptools
6+
- if [[ $(python -V 2>&1) == *"2.7"* ]]; then sudo apt-get install -y python-setuptools; fi
77
- npm install -g typescript
88
- tsc --module amd --noImplicitAny --outdir datalab/notebook/static datalab/notebook/static/*.ts
99
- pip install -U pip
10-
- pip install -U setuptools
10+
- if [[ $(python -V 2>&1) == *"2.7"* ]]; then pip install -U setuptools; fi
1111
- pip install .
1212

1313
script: python ./tests/main.py

setup.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
# To publish to PyPi use: python setup.py bdist_wheel upload -r pypi
1414

1515
import datetime
16-
import platform
16+
import sys
1717
from setuptools import setup
18-
import pip
18+
19+
if sys.version_info[0] == 2:
20+
import platform
21+
import pip
1922

2023
minor = datetime.datetime.now().strftime("%y%m%d%H%M")
2124
version = '0.1.' + minor
@@ -107,21 +110,23 @@
107110
}
108111
)
109112

110-
tensorflow_path = None
111-
if platform.system() == 'Darwin':
112-
tensorflow_path = 'https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py2-none-any.whl'
113-
elif platform.system() == 'Linux':
114-
if platform.linux_distribution()[0] == 'Ubuntu':
115-
tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl'
116-
elif platform.linux_distribution()[0] == 'Debian':
117-
tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/debian/jessie/tensorflow-0.11.0-cp27-none-linux_x86_64.whl'
113+
# for python2 only, install tensorflow and cloudml
114+
if sys.version_info[0] == 2:
115+
tensorflow_path = None
116+
if platform.system() == 'Darwin':
117+
tensorflow_path = 'https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py2-none-any.whl'
118+
elif platform.system() == 'Linux':
119+
if platform.linux_distribution()[0] == 'Ubuntu':
120+
tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl'
121+
elif platform.linux_distribution()[0] == 'Debian':
122+
tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/debian/jessie/tensorflow-0.11.0-cp27-none-linux_x86_64.whl'
118123

119-
# install tensorflow
120-
if not tensorflow_path:
121-
print("""Warning: could not find tensorflow build for your OS.
122-
Please go to https://www.tensorflow.org/get_started/os_setup to see install options""")
123-
else:
124-
pip.main(['install', tensorflow_path])
124+
# install tensorflow
125+
if not tensorflow_path:
126+
print("""Warning: could not find tensorflow build for your OS.
127+
Please go to https://www.tensorflow.org/get_started/os_setup to see install options""")
128+
else:
129+
pip.main(['install', tensorflow_path])
125130

126-
# install cloud ml sdk
127-
pip.main(['install', 'https://storage.googleapis.com/cloud-ml/sdk/cloudml.latest.tar.gz'])
131+
# install cloud ml sdk
132+
pip.main(['install', 'https://storage.googleapis.com/cloud-ml/sdk/cloudml.latest.tar.gz'])

0 commit comments

Comments
 (0)