Skip to content

Commit 11de2ac

Browse files
committed
Merge branch 'master' of https://github.com/cosmo-ethz/hope.git
2 parents c3d1e05 + 9f6f43b commit 11de2ac

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ before_install:
1010
- sudo ln -sf /usr/bin/g++-4.8 /usr/bin/g++
1111

1212
python:
13+
- "3.4"
1314
- "3.3"
1415
- "2.7"
1516
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors

hope/_tosource.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,16 @@ def write_comma():
137137
self.visit(default)
138138
if node.vararg is not None:
139139
write_comma()
140-
self.write('*' + node.vararg)
140+
if hasattr(node.vararg, "arg"): # py34
141+
self.write('*' + node.vararg.arg)
142+
else:
143+
self.write('*' + node.vararg)
141144
if node.kwarg is not None:
142145
write_comma()
143-
self.write('**' + node.kwarg)
146+
if hasattr(node.kwarg, "arg"): # py34
147+
self.write('**' + node.kwarg.arg)
148+
else:
149+
self.write('**' + node.kwarg)
144150

145151
def decorators(self, node):
146152
for decorator in node.decorator_list:
@@ -445,6 +451,9 @@ def write_comma():
445451
def visit_Name(self, node):
446452
self.write(node.id)
447453

454+
def visit_NameConstant(self, node):
455+
self.write(str(node.value))
456+
448457
def visit_Str(self, node):
449458
if node.s.find("\n") > -1 and len(node.s)>1:
450459
self.write("'''%s'''"%node.s)

hope/_transformer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ def visit_Name(self, node):
346346

347347
return self.variables[node.id]
348348

349+
def visit_NameConstant(self, node): #new in Py34
350+
return Number(node.value)
351+
349352
def visit_Slice(self, node):
350353
if not node.step is None:
351354
raise Exception("Step size other than 1 are not supported")

test/utilities.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@
99
import hope, itertools, pytest, sys, sysconfig, os, shutil, copy
1010
hope.rangecheck = True
1111

12+
# TODO: differentiate between TravisCI (50min limit) and local + different python versions
1213
# TODO: implement complex
1314
# min_dtypes = [np.int8, np.uint64, np.float32, np.float64]
1415
min_dtypes = [np.int8, np.uint64, np.float64]
1516
# dtypes = [np.longlong, np.ulonglong, np.int8, np.int32, np.uint16, np.uint64, np.float32, np.float64, int, float]
16-
dtypes = [np.ulonglong, np.int8, np.int32, np.uint64, np.float32, int, float]
17+
18+
if sys.version_info[0] == 3: #PY3 seems to be slower on TravisCI
19+
dtypes = [np.ulonglong, np.int8, np.uint64, np.float32, int, float]
20+
else:
21+
dtypes = [np.ulonglong, np.int8, np.int32, np.uint64, np.float32, int, float]
1722
#shapes = [[], [1200], [30, 13]]
1823
shapes = [[], [3, 4]]
1924

tox.ini

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
[tox]
2-
envlist = py27, py33, docs-ci
2+
envlist = py27, py33, py34, docs-ci
33

44
[testenv]
55
setenv =
66
PYTHONPATH = {toxinidir}:{toxinidir}/hope
77
deps =
88
-r{toxinidir}/requirements.txt
9-
pytest
10-
pytest-cov
119
commands =
1210
py.test --basetemp={envtmpdir} --junitxml=junit-{envname}.xml --cov-report xml --cov hope
1311

@@ -33,8 +31,6 @@ changedir=docs/
3331
deps =
3432
-r{toxinidir}/requirements.txt
3533
sphinx
36-
pytest
37-
pytest-cov
3834
commands=
3935
py.test --tb=line -v --junitxml=junit-{envname}.xml check_sphinx.py --cov-report xml --cov hope
4036
mv coverage.xml ../.

0 commit comments

Comments
 (0)