Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Change travis to run with python3.5 #754

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 11 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: python
python: 2.7
python: 3.5
sudo: required
dist: trusty
env:
#matrix:
#- TOX_ENV=py27
#- TOX_ENV=py34
#- TOX_ENV=py35
matrix:
- TOX_ENV=py27
- TOX_ENV=py34
- TOX_ENV=py35
global:
- COVERAGE_APPEND="--append"
- secure: cKbIgpTJ1yjKLBxpCEiT6IH7NShDWZUE+BvnrAfc+ujCsR6LyLJcKxFQmKnWryJCqg7fp82Ep2bF2oDKzanAROar2xDY1SFGbai42seYMaFCw53YPGJ6u3VNCcfT0rN9BWgE7el/m4fjcD6CRsZYKArNNJbMX8csRt3uXXCFLso=
Expand All @@ -30,15 +30,13 @@ install:
- travis_retry python setup.py install
- travis_retry pip install -r dev_requirements.txt
script:
# XXX: For now we're only performing minimal CI checks as most tests are
# broken. Tests will be individually added here as they're fixed.
# XXX: For now we're only performing minimal lint checks as there are way
# too many issues. Once they're all addressed we should change this to 'make
# lint'.
- make lint-minimal
- make test-passing
#- if [ -d .tox/$TOX_ENV/ ]; then cd .tox/$TOX_ENV && coverage erase; fi;
#- tox -e $TOX_ENV -- --ignore ethereum/tests/test_vm.py --ignore ethereum/tests/test_state.py
#- tox -e $TOX_ENV -- ethereum/tests/test_vm.py
#- tox -e $TOX_ENV -- ethereum/tests/test_state.py
#- coverage report --show-missing
- if [ -d .tox/$TOX_ENV/ ]; then cd .tox/$TOX_ENV && coverage erase; fi;
- tox -e $TOX_ENV -- --ignore ethereum/todo_tests
- coverage report --show-missing
after_success:
- travis_retry pip install coveralls
- cd .tox/$TOX_ENV && coveralls
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ lint-minimal:
python -m flake8 --ignore=F401,F841,F811 --select=F --exclude=todo,experimental,ethash.py,ethash_utils.py ethereum

test:
py.test --tb=no ethereum/tests/
py.test ethereum/tests/

test-passing:
py.test ethereum/tests/test_abi.py ethereum/tests/test_bloom.py ethereum/tests/test_chain.py ethereum/tests/test_compress.py ethereum/tests/test_db.py ethereum/tests/test_difficulty.py ethereum/tests/test_opcodes.py ethereum/tests/test_trie_next_prev.py ethereum/tests/test_genesis.py ethereum/tests/test_serialization.py ethereum/tests/test_trie.py

test-failing:
py.test ethereum/tests/test_blockstransactions.py ethereum/tests/test_transactions.py ethereum/tests/test_keys.py ethereum/tests/test_state.py ethereum/tests/test_contracts.py ethereum/tests/test_tester.py
test-todo:
py.test --continue-on-collection-errors ethereum/todo_tests

testnovm:
py.test --tb=no ethereum/tests/ --ignore=ethereum/tests/test_vm.py
Expand Down
2 changes: 1 addition & 1 deletion ethereum/pow/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def get_blockhashes_from_hash(self, hash, max):

header = block.header
hashes = []
for i in xrange(max):
for i in range(max):
hash = header.prevhash
block = self.get_block(hash)
if block is None:
Expand Down
7 changes: 6 additions & 1 deletion ethereum/slogging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import json
import sys
import textwrap
from json.encoder import JSONEncoder
from logging import StreamHandler, Formatter, FileHandler
Expand Down Expand Up @@ -262,11 +263,15 @@ def getLogger(self, name):


def _stringify_dict_keys(input_):
if sys.version_info.major == 2:
longType = long # NOQA
else:
longType = int
if isinstance(input_, dict):
res = {}
for k, v in input_.items():
v = _stringify_dict_keys(v)
if not isinstance(k, (int, long, bool, None.__class__)):
if not isinstance(k, (int, longType, bool, None.__class__)):
k = str(k)
res[k] = v
elif isinstance(input_, (list, tuple)):
Expand Down
7 changes: 3 additions & 4 deletions ethereum/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ def int_to_big_endian(x): return big_endian_int.serialize(x)
SECP256K1P = 2**256 - 4294968273

if sys.version_info.major == 2:
def is_numeric(x): return isinstance(x, (int, long))

def is_string(x): return isinstance(x, (str, unicode))
is_numeric = lambda x: isinstance(x, (int, long)) # NOQA
is_string = lambda x: isinstance(x, (str, unicode)) # NOQA

def to_string(value):
return str(value)
Expand All @@ -49,7 +48,7 @@ def int_to_bytes(value):

def to_string_for_regexp(value):
return str(value)
unicode = unicode
unicode = unicode # NOQA

def bytearray_to_bytestr(value):
return bytes(''.join(chr(c) for c in value))
Expand Down