From 56ab03042343668108bb6b6de19f9433f8f2eb9a Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Mon, 8 Oct 2018 22:44:06 -0400 Subject: [PATCH] Python37 (#12) * add dist: xenial * try travis fix with matrix include. * remove unnecessary elif --- .travis.yml | 11 ++++++++--- rfd/api.py | 2 +- rfd/rfd_cli.py | 2 +- tox.ini | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e60d96..894b3f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,21 @@ -sudo: false language: python +sudo: false python: - "2.7" - "3.5" - "3.6" - # - "3.7" +# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs +matrix: + include: + - python: 3.7 + dist: xenial + sudo: true before_install: - "pip install -U pip" - "python setup.py install" install: - pip install tox-travis - - pip install pytest==3.6.0 + - pip install pytest - pip install pylint script: - tox diff --git a/rfd/api.py b/rfd/api.py index 0e4a402..5402a18 100644 --- a/rfd/api.py +++ b/rfd/api.py @@ -54,7 +54,7 @@ def calculate_score(post): def get_safe_per_page(limit): if limit < 5: return 5 - elif limit > 40: + if limit > 40: return 40 return limit diff --git a/rfd/rfd_cli.py b/rfd/rfd_cli.py index ee465e4..d608333 100644 --- a/rfd/rfd_cli.py +++ b/rfd/rfd_cli.py @@ -29,7 +29,7 @@ def get_terminal_width(): def get_vote_color(score): if score > 0: return Fore.GREEN + " [+" + str(score) + "] " - elif score < 0: + if score < 0: return Fore.RED + " [" + str(score) + "] " return Fore.BLUE + " [" + str(score) + "] " diff --git a/tox.ini b/tox.ini index ce5b8de..040bf9a 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{27, 35, 36, - #37, + 37, } [testenv]