From dd6067dbf4f6e9c9691ec6fcb9e06f8d5122065f Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 9 Apr 2014 10:17:20 +0300 Subject: [PATCH 1/7] Coverage badge in README [ci skip] --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 78a256c0d..cf9039b70 100644 --- a/README.rst +++ b/README.rst @@ -16,4 +16,7 @@ Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is the Pyt :target: https://pypi.python.org/pypi/Pillow/ :alt: Number of PyPI downloads +.. image:: https://coveralls.io/repos/python-imaging/Pillow/badge.png?branch=master + :target: https://coveralls.io/r/python-imaging/Pillow?branch=master + The documentation is hosted at http://pillow.readthedocs.org/. It contains installation instructions, tutorials, reference, compatibility details, and more. From 1cb4bf7c1514c866c28c4b79ec22e885499aaab0 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 9 Apr 2014 10:33:13 +0300 Subject: [PATCH 2/7] SVG Travis, and Coverage badge in docs [ci skip] The SVG badge uses the Shields project for consistency with other projects' badges. More info: http://blog.travis-ci.com/2014-03-20-build-status-badges-support-svg/ --- docs/index.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index a59cda115..520addd93 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,8 +4,9 @@ Pillow Pillow is the 'friendly' PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. -.. image:: https://travis-ci.org/python-imaging/Pillow.png +.. image:: https://travis-ci.org/python-imaging/Pillow.svg?branch=master :target: https://travis-ci.org/python-imaging/Pillow + :alt: GitHub build status .. image:: https://pypip.in/v/Pillow/badge.png :target: https://pypi.python.org/pypi/Pillow/ @@ -15,6 +16,10 @@ Python Imaging Library by Fredrik Lundh and Contributors. :target: https://pypi.python.org/pypi/Pillow/ :alt: Number of PyPI downloads +.. image:: https://coveralls.io/repos/python-imaging/Pillow/badge.png?branch=master + :target: https://coveralls.io/r/python-imaging/Pillow?branch=master + :alt: Test coverage + To start using Pillow, please read the :doc:`installation instructions `. From 0378a89c6455bc67b1bea5f163e9fca649a1f650 Mon Sep 17 00:00:00 2001 From: hugovk Date: Wed, 9 Apr 2014 10:37:03 +0300 Subject: [PATCH 3/7] Use SVG Travis CI badge [ci skip] --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index cf9039b70..277c5d01f 100644 --- a/README.rst +++ b/README.rst @@ -5,8 +5,9 @@ Pillow Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. -.. image:: https://travis-ci.org/python-imaging/Pillow.png +.. image:: https://travis-ci.org/python-imaging/Pillow.svg?branch=master :target: https://travis-ci.org/python-imaging/Pillow + :alt: Travis CI build status .. image:: https://pypip.in/v/Pillow/badge.png :target: https://pypi.python.org/pypi/Pillow/ From 5a63e77097eaa9b8c331b24c5ae2978a14ce065d Mon Sep 17 00:00:00 2001 From: hugovk Date: Wed, 9 Apr 2014 10:40:16 +0300 Subject: [PATCH 4/7] Fix alt text [ci skip] --- docs/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 520addd93..25e9f6b73 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -Pillow +Pillow ====== Pillow is the 'friendly' PIL fork by Alex Clark and Contributors. PIL is the @@ -6,7 +6,7 @@ Python Imaging Library by Fredrik Lundh and Contributors. .. image:: https://travis-ci.org/python-imaging/Pillow.svg?branch=master :target: https://travis-ci.org/python-imaging/Pillow - :alt: GitHub build status + :alt: Travis CI build status .. image:: https://pypip.in/v/Pillow/badge.png :target: https://pypi.python.org/pypi/Pillow/ @@ -53,7 +53,7 @@ Pillow is a volunteer effort led by Alex Clark. If you can't help with development please consider helping us financially. Your assistance would be very much appreciated! -.. note:: Contributors please add your name and donation preference here. +.. note:: Contributors please add your name and donation preference here. ======================================= ======================================= **Developer** **Preference** From 267cdf523eb1280f247e95dfb48949d870b7f18c Mon Sep 17 00:00:00 2001 From: hugovk Date: Fri, 11 Apr 2014 10:28:06 +0300 Subject: [PATCH 5/7] Print out lists of failed tests (and temporarily force a failure for testing) --- Tests/run.py | 31 ++++++++++++++++++++----------- Tests/test_mode_i16.py | 8 ++++++-- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Tests/run.py b/Tests/run.py index 01a3f3603..57fc5245d 100644 --- a/Tests/run.py +++ b/Tests/run.py @@ -2,7 +2,12 @@ from __future__ import print_function # minimal test runner -import glob, os, os.path, sys, tempfile, re +import glob +import os +import os.path +import re +import sys +import tempfile try: root = os.path.dirname(__file__) @@ -34,6 +39,7 @@ files.sort() success = failure = 0 include = [x for x in sys.argv[1:] if x[:2] != "--"] skipped = [] +failed = [] python_options = " ".join(python_options) tester_options = " ".join(tester_options) @@ -48,8 +54,8 @@ for file in files: # 2>&1 works on unix and on modern windowses. we might care about # very old Python versions, but not ancient microsoft products :-) out = os.popen("%s %s -u %s %s 2>&1" % ( - sys.executable, python_options, file, tester_options - )) + sys.executable, python_options, file, tester_options + )) result = out.read() # Extract any ignore patterns @@ -63,7 +69,7 @@ for file in files: if not p.endswith('$'): p = p + '$' return p - + ignore_res = [re.compile(fix_re(p), re.MULTILINE) for p in ignore_pats] except: print('(bad ignore patterns %r)' % ignore_pats) @@ -73,11 +79,11 @@ for file in files: result = r.sub('', result) result = result.strip() - + if result == "ok": result = None elif result == "skip": - print("---", "skipped") # FIXME: driver should include a reason + print("---", "skipped") # FIXME: driver should include a reason skipped.append(test) continue elif not result: @@ -91,7 +97,7 @@ for file in files: # if there's an ok at the end, it's not really ok result = result[:-3] print(result) - failure = failure + 1 + failed.append[test] else: success = success + 1 @@ -105,6 +111,7 @@ if tempfiles: print(file) print("-"*68) + def tests(n): if n == 1: return "1 test" @@ -112,10 +119,12 @@ def tests(n): return "%d tests" % n if skipped: - print("---", tests(len(skipped)), "skipped.") - print(skipped) -if failure: - print("***", tests(failure), "of", (success + failure), "failed.") + print("---", tests(len(skipped)), "skipped:") + print(", ".join(skipped)) +if failed: + failure = len(failed) + print("***", tests(failure), "of", (success + failure), "failed:") + print(", ".join(failed)) sys.exit(1) else: print(tests(success), "passed.") diff --git a/Tests/test_mode_i16.py b/Tests/test_mode_i16.py index 4c1798509..2130ee3f6 100644 --- a/Tests/test_mode_i16.py +++ b/Tests/test_mode_i16.py @@ -2,6 +2,7 @@ from tester import * from PIL import Image + def verify(im1): im2 = lena("I") assert_equal(im1.size, im2.size) @@ -18,6 +19,7 @@ def verify(im1): return success() + def test_basic(): # PIL 1.1 has limited support for 16-bit image data. Check that # create/copy/transform and save works as expected. @@ -30,10 +32,10 @@ def test_basic(): w, h = imIn.size imOut = imIn.copy() - verify(imOut) # copy + verify(imOut) # copy imOut = imIn.transform((w, h), Image.EXTENT, (0, 0, w, h)) - verify(imOut) # transform + verify(imOut) # transform filename = tempfile("temp.im") imIn.save(filename) @@ -103,3 +105,5 @@ def test_convert(): verify(im.convert("I;16B")) verify(im.convert("I;16B").convert("L")) verify(im.convert("I;16B").convert("I")) + + assert(False) # TEMP FOR TESTING! From cf6daf03fedaa5a63172733394d8d023230c844d Mon Sep 17 00:00:00 2001 From: hugovk Date: Fri, 11 Apr 2014 10:47:37 +0300 Subject: [PATCH 6/7] Use correct brackets --- Tests/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/run.py b/Tests/run.py index 57fc5245d..4dccc005a 100644 --- a/Tests/run.py +++ b/Tests/run.py @@ -97,7 +97,7 @@ for file in files: # if there's an ok at the end, it's not really ok result = result[:-3] print(result) - failed.append[test] + failed.append(test) else: success = success + 1 From 9c6b07d21b84c66df7cc168a95e93da2721b9873 Mon Sep 17 00:00:00 2001 From: hugovk Date: Fri, 11 Apr 2014 10:59:58 +0300 Subject: [PATCH 7/7] Remove temporary forced failure --- Tests/test_mode_i16.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/test_mode_i16.py b/Tests/test_mode_i16.py index 2130ee3f6..782a26623 100644 --- a/Tests/test_mode_i16.py +++ b/Tests/test_mode_i16.py @@ -105,5 +105,3 @@ def test_convert(): verify(im.convert("I;16B")) verify(im.convert("I;16B").convert("L")) verify(im.convert("I;16B").convert("I")) - - assert(False) # TEMP FOR TESTING!