From 2cb07872fe110e1addf6f15601349d4d64e1552b Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 17 May 2017 10:44:14 -0700 Subject: [PATCH 1/6] Add a makefile target for testing the readme --- Makefile | 3 +++ Pipfile | 1 + 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 34dbe6a3..3a00b0c7 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ test: # the -k flag, like "py.test -k test_path_is_not_double_encoded" pipenv run py.test tests +test-readme: + pipenv run python setup.py check -r -s + coverage: pipenv run py.test --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=requests tests diff --git a/Pipfile b/Pipfile index 617c7ffa..ffb748ab 100644 --- a/Pipfile +++ b/Pipfile @@ -11,3 +11,4 @@ pytest-mock = "*" pytest-cov = "*" pysocks = "*" alabaster = "*" +readme_renderer = "*" From 37ef88885cbc80b007869a53919f0b8db7053ace Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 17 May 2017 10:46:05 -0700 Subject: [PATCH 2/6] Test the readme in travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 600f79cd..51fb563e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ python: install: "make" # command to run tests script: + - make test-readme - make coverage after_success: - pipenv run codecov From 1553770014dc1579d74b79f7b20dea5184242ef4 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 17 May 2017 10:54:06 -0700 Subject: [PATCH 3/6] Fixup broken changelog --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index c6123ee6..53263033 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -47,7 +47,7 @@ Release History **Bugfixes** - Much improved handling of non-ASCII ``Location`` header values in redirects. - Fewer ``UnicodeDecodeError``s are encountered on Python 2, and Python 3 now + Fewer ``UnicodeDecodeErrors`` are encountered on Python 2, and Python 3 now correctly understands that Latin-1 is unlikely to be the correct encoding. - If an attempt to ``seek`` file to find out its length fails, we now appropriately handle that by aborting our content-length calculations. From 52a2efa2ae5d57c13bf6bb13901f1762af20a55a Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 17 May 2017 19:54:31 -0500 Subject: [PATCH 4/6] Avoid verifying the README.rst on Python 2.6 readme-render does not appear to support Python 2.6. This causes tests to fail on Travis' 2.6 environment. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 51fb563e..6d9c8140 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ python: install: "make" # command to run tests script: - - make test-readme + - [[ "$TRAVIS_PYTHON_VERSION" != "2.6" ]] && make test-readme - make coverage after_success: - pipenv run codecov From e2142a1e542d9039d5608eaeb9dfb46743f26d38 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 17 May 2017 18:02:28 -0700 Subject: [PATCH 5/6] Alex said this would work --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6d9c8140..19a9ed79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,8 @@ python: install: "make" # command to run tests script: - - [[ "$TRAVIS_PYTHON_VERSION" != "2.6" ]] && make test-readme + - | + [[ "$TRAVIS_PYTHON_VERSION" != "2.6" ]] && make test-readme - make coverage after_success: - pipenv run codecov From 570c4c83a506e0999437a23fd54f6fc5b3a12d64 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 17 May 2017 20:06:42 -0500 Subject: [PATCH 6/6] Amend the syntax for skipping the readme check --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 19a9ed79..e456e0cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ install: "make" # command to run tests script: - | - [[ "$TRAVIS_PYTHON_VERSION" != "2.6" ]] && make test-readme + if [[ "$TRAVIS_PYTHON_VERSION" != "2.6" ]] ; then make test-readme; fi - make coverage after_success: - pipenv run codecov