Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cosmo-ethz/hope.git
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeret committed Oct 24, 2014
2 parents c3d1e05 + 9f6f43b commit 11de2ac
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ before_install:
- sudo ln -sf /usr/bin/g++-4.8 /usr/bin/g++

python:
- "3.4"
- "3.3"
- "2.7"
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
Expand Down
13 changes: 11 additions & 2 deletions hope/_tosource.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,16 @@ def write_comma():
self.visit(default)
if node.vararg is not None:
write_comma()
self.write('*' + node.vararg)
if hasattr(node.vararg, "arg"): # py34
self.write('*' + node.vararg.arg)
else:
self.write('*' + node.vararg)
if node.kwarg is not None:
write_comma()
self.write('**' + node.kwarg)
if hasattr(node.kwarg, "arg"): # py34
self.write('**' + node.kwarg.arg)
else:
self.write('**' + node.kwarg)

def decorators(self, node):
for decorator in node.decorator_list:
Expand Down Expand Up @@ -445,6 +451,9 @@ def write_comma():
def visit_Name(self, node):
self.write(node.id)

def visit_NameConstant(self, node):
self.write(str(node.value))

def visit_Str(self, node):
if node.s.find("\n") > -1 and len(node.s)>1:
self.write("'''%s'''"%node.s)
Expand Down
3 changes: 3 additions & 0 deletions hope/_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ def visit_Name(self, node):

return self.variables[node.id]

def visit_NameConstant(self, node): #new in Py34
return Number(node.value)

def visit_Slice(self, node):
if not node.step is None:
raise Exception("Step size other than 1 are not supported")
Expand Down
7 changes: 6 additions & 1 deletion test/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
import hope, itertools, pytest, sys, sysconfig, os, shutil, copy
hope.rangecheck = True

# TODO: differentiate between TravisCI (50min limit) and local + different python versions
# TODO: implement complex
# min_dtypes = [np.int8, np.uint64, np.float32, np.float64]
min_dtypes = [np.int8, np.uint64, np.float64]
# dtypes = [np.longlong, np.ulonglong, np.int8, np.int32, np.uint16, np.uint64, np.float32, np.float64, int, float]
dtypes = [np.ulonglong, np.int8, np.int32, np.uint64, np.float32, int, float]

if sys.version_info[0] == 3: #PY3 seems to be slower on TravisCI
dtypes = [np.ulonglong, np.int8, np.uint64, np.float32, int, float]
else:
dtypes = [np.ulonglong, np.int8, np.int32, np.uint64, np.float32, int, float]
#shapes = [[], [1200], [30, 13]]
shapes = [[], [3, 4]]

Expand Down
6 changes: 1 addition & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[tox]
envlist = py27, py33, docs-ci
envlist = py27, py33, py34, docs-ci

[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/hope
deps =
-r{toxinidir}/requirements.txt
pytest
pytest-cov
commands =
py.test --basetemp={envtmpdir} --junitxml=junit-{envname}.xml --cov-report xml --cov hope

Expand All @@ -33,8 +31,6 @@ changedir=docs/
deps =
-r{toxinidir}/requirements.txt
sphinx
pytest
pytest-cov
commands=
py.test --tb=line -v --junitxml=junit-{envname}.xml check_sphinx.py --cov-report xml --cov hope
mv coverage.xml ../.

0 comments on commit 11de2ac

Please sign in to comment.