From 212101dd364d23e156999d1950e90b60fd43ab7d Mon Sep 17 00:00:00 2001 From: aleju Date: Sun, 2 Jun 2019 11:11:19 +0200 Subject: [PATCH 1/4] Mark external file as unused --- CHANGELOG.md | 3 +++ .../{poly_point_isect.py => poly_point_isect_py3.py.bak} | 0 2 files changed, 3 insertions(+) rename imgaug/external/{poly_point_isect.py => poly_point_isect_py3.py.bak} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3d04338c..a2dd8a0ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ `True` and `False` values. * Added augmenter `Canny`, which applies canny edge detection with alpha blending and random coloring to images. +* Renamed `imgaug/external/poly_point_isect.py` to `imgaug/external/poly_point_isect_py3.py.bak`. + The file is in the library only for completeness and contains python3 syntax. + `poly_point_isect_py2py3.py` is actually used. ## Fixes diff --git a/imgaug/external/poly_point_isect.py b/imgaug/external/poly_point_isect_py3.py.bak similarity index 100% rename from imgaug/external/poly_point_isect.py rename to imgaug/external/poly_point_isect_py3.py.bak From 2b9e1ff62673da4481b5d50b0d7857258a004887 Mon Sep 17 00:00:00 2001 From: aleju Date: Sun, 2 Jun 2019 11:13:22 +0200 Subject: [PATCH 2/4] Add note about not using py3 file --- imgaug/external/poly_point_isect_py3.py.bak | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/imgaug/external/poly_point_isect_py3.py.bak b/imgaug/external/poly_point_isect_py3.py.bak index 7af0a54de..b74c33795 100644 --- a/imgaug/external/poly_point_isect_py3.py.bak +++ b/imgaug/external/poly_point_isect_py3.py.bak @@ -1,3 +1,12 @@ +############################################################################# +# This file uses python3 syntax. The actually used version of this library is +# in "(...)_py2py3.py". This (original) file is added for completeness. +# To avoid fatal errors related to the test environment in python2.7, it +# ends in ".py.bak", so that the file is always ignored. +# (There are probably more elegant ways to achieve this.) +############################################################################# + + # BentleyOttmann sweep-line implementation # (for finding all intersections in a set of line segments) From 8bb72f883ce72dad6ce7dd7c598e30f7309792cc Mon Sep 17 00:00:00 2001 From: aleju Date: Sun, 2 Jun 2019 11:13:46 +0200 Subject: [PATCH 3/4] Fix broken example in docstring --- imgaug/augmenters/meta.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/imgaug/augmenters/meta.py b/imgaug/augmenters/meta.py index c3dde9967..01cfc50e3 100644 --- a/imgaug/augmenters/meta.py +++ b/imgaug/augmenters/meta.py @@ -3255,16 +3255,19 @@ def OneOf(children, name=None, deterministic=False, random_state=None): Examples -------- - >>> imgs = [np.ones((10, 10))] + >>> import imgaug.augmenters as iaa + >>> images = [np.ones((10, 10), dtype=np.uint8)] >>> seq = iaa.OneOf([ >>> iaa.Fliplr(1.0), >>> iaa.Flipud(1.0) >>> ]) - >>> imgs_aug = seq.augment_images(imgs) + >>> imgs_aug = seq.augment_images(images) - flips each image either horizontally or vertically. + Flips each image either horizontally or vertically. + >>> import imgaug.augmenters as iaa + >>> images = [np.ones((10, 10), dtype=np.uint8)] >>> seq = iaa.OneOf([ >>> iaa.Fliplr(1.0), >>> iaa.Sequential([ @@ -3274,9 +3277,9 @@ def OneOf(children, name=None, deterministic=False, random_state=None): >>> ]), >>> iaa.Noop() >>> ]) - >>> imgs_aug = seq.augment_images(imgs) + >>> imgs_aug = seq.augment_images(images) - either flips each image horizontally, or adds blur+dropout+noise or does + Either flips each image horizontally, or adds blur+dropout+noise or does nothing. """ From e99f42d2a16bef4373a8ad74dc706e449d694df2 Mon Sep 17 00:00:00 2001 From: aleju Date: Sun, 2 Jun 2019 11:25:29 +0200 Subject: [PATCH 4/4] Block pytest 4.6.0 for now due to crashes --- .travis.yml | 4 +++- test/requirements.txt | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f8facd15..62c1b223e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,9 @@ install: # - virtualenv venv # - . venv/bin/activate - pip install -r requirements.txt - - pip install -r test/requirements.txt + # Added --upgrade, because at least pytest already came from some other + # install command and so version was never checked + - pip install --upgrade -r test/requirements.txt - pip install coverage codecov pytest-cov codacy-coverage - pip install . diff --git a/test/requirements.txt b/test/requirements.txt index 7914b45e7..ac19a37a4 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,4 +1,5 @@ -pytest>=3.0.5 +# 4.6.0 currently causes crashes, see https://github.com/pytest-dev/pytest/issues/5358 +pytest>=3.0.5,<4.6.0 mock; python_version < '3.3' # unittest.mock does not exist in older versions unittest2; python_version < '3.4' # in 3.4, self.subTest was added xdoctest >= 0.7.2