From 34d198fe5a36e788d5383ca2443aa60b5e7ca2ed Mon Sep 17 00:00:00 2001 From: Linas Valiukas Date: Wed, 26 Sep 2018 08:45:34 +0300 Subject: [PATCH 1/5] Add Python 3.7 classifier --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 09744b8..9d68b6e 100755 --- a/setup.py +++ b/setup.py @@ -43,5 +43,6 @@ setup( "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", ], ) From bdb6d671d855b5f3a018a6b88be924805370afed Mon Sep 17 00:00:00 2001 From: Linas Valiukas Date: Wed, 26 Sep 2018 08:45:57 +0300 Subject: [PATCH 2/5] Test with Python 3.7 on Travis --- .travis.yml | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8cbcf71..c8cd5d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: - TOX_ENV=py34 # - TOX_ENV=py35 - TOX_ENV=py36 + - TOX_ENV=py37 before_install: # work around https://github.com/travis-ci/travis-ci/issues/8363 diff --git a/tox.ini b/tox.ini index 89239db..e0d944f 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py27, py35, py36 +envlist = py27, py35, py36, py37 [testenv] deps=pytest From 63fbc36cb83b10e9ae30d33fcbe23a3cdb4a5469 Mon Sep 17 00:00:00 2001 From: Linas Valiukas Date: Wed, 26 Sep 2018 08:48:03 +0300 Subject: [PATCH 3/5] Close sample input file after reading it Otherwise tests spit out: ResourceWarning: unclosed file <_io.TextIOWrapper name='/Users/pypt/Dropbox/etc-MediaCloud/python-readability/tests/samples/si-game.sample.html' mode='r' encoding='UTF-8'> return open(os.path.join(SAMPLES, filename)).read() --- tests/test_article_only.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_article_only.py b/tests/test_article_only.py index 87e623c..5d5b813 100644 --- a/tests/test_article_only.py +++ b/tests/test_article_only.py @@ -9,7 +9,9 @@ SAMPLES = os.path.join(os.path.dirname(__file__), 'samples') def load_sample(filename): """Helper to get the content out of the sample files""" - return open(os.path.join(SAMPLES, filename)).read() + with open(os.path.join(SAMPLES, filename)) as f: + html = f.read() + return html class TestArticleOnly(unittest.TestCase): From 34fce7664d3cddfa3414356823b37a85367c63f9 Mon Sep 17 00:00:00 2001 From: Linas Valiukas Date: Wed, 26 Sep 2018 09:11:54 +0300 Subject: [PATCH 4/5] Update Python version in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c8cd5d8..9669859 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: - - "3.6" + - "3.7" env: - TOX_ENV=py27 From 68fb5ad4c09e6c9f5c932b5629f9459099a3ebdb Mon Sep 17 00:00:00 2001 From: Linas Valiukas Date: Wed, 26 Sep 2018 09:16:28 +0300 Subject: [PATCH 5/5] Try a workaround to make build work on 3.7 https://github.com/travis-ci/travis-ci/issues/9815 --- .travis.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9669859..a16e41b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,22 @@ language: python python: - - "3.7" + - "3.6" + +# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs +matrix: + include: + - name: "Python: 3.7" + python: "3.7" + dist: xenial + sudo: true + env: TOX_ENV=py37 env: - TOX_ENV=py27 - TOX_ENV=py34 # - TOX_ENV=py35 - TOX_ENV=py36 - - TOX_ENV=py37 before_install: # work around https://github.com/travis-ci/travis-ci/issues/8363