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/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/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. """ diff --git a/imgaug/external/poly_point_isect.py b/imgaug/external/poly_point_isect_py3.py.bak similarity index 98% rename from imgaug/external/poly_point_isect.py rename to imgaug/external/poly_point_isect_py3.py.bak index 7af0a54de..b74c33795 100644 --- a/imgaug/external/poly_point_isect.py +++ 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) 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