Skip to content

Commit

Permalink
Add AppVeyor config for Windows builds (albumentations-team#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
creafz authored and albu committed Jan 6, 2019
1 parent 9734a1e commit 662bb94
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
build: off

cache:
- '%LOCALAPPDATA%\pip\Cache'

environment:
IMGAUG_NO_CV2_INSTALLED_CHECK: 'TRUE'

matrix:
- PYTHON: 'C:\Python27-x64'
SHAPELY_WHEEL: 'https://download.lfd.uci.edu/pythonlibs/r5uhg2lo/Shapely-1.6.4.post1-cp27-cp27m-win_amd64.whl'
- PYTHON: 'C:\Python35-x64'
SHAPELY_WHEEL: 'https://download.lfd.uci.edu/pythonlibs/r5uhg2lo/Shapely-1.6.4.post1-cp35-cp35m-win_amd64.whl'
- PYTHON: 'C:\Python36-x64'
SHAPELY_WHEEL: 'https://download.lfd.uci.edu/pythonlibs/r5uhg2lo/Shapely-1.6.4.post1-cp36-cp36m-win_amd64.whl'
- PYTHON: 'C:\Python37-x64'
SHAPELY_WHEEL: 'https://download.lfd.uci.edu/pythonlibs/r5uhg2lo/Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl'

install:
- '%PYTHON%\python.exe -m pip install -U pip wheel setuptools'
- '%PYTHON%\python.exe -m pip install %SHAPELY_WHEEL%'
- '%PYTHON%\python.exe -m pip install .[tests]'
- '%PYTHON%\python.exe -m pip install flake8 flake8-docstrings'

test_script:
- '%PYTHON%\python.exe -m pytest'
- '%PYTHON%\python.exe -m flake8'
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import os

import numpy as np
import pytest


skip_appveyor = pytest.mark.skipif(
'APPVEYOR' in os.environ,
reason='Skipping test in AppVeyor',
)


@pytest.fixture
def image():
return np.random.randint(low=0, high=256, size=(100, 100, 3), dtype=np.uint8)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def test_resize_default_interpolation_float(target):
height, width = resized_img.shape[:2]
assert height == 2
assert width == 2
assert np.array_equal(resized_img, expected)
assert_array_almost_equal_nulp(resized_img, expected)


@pytest.mark.parametrize('target', ['image', 'mask'])
Expand Down
2 changes: 2 additions & 0 deletions tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
VerticalFlip, HorizontalFlip, RandomSizedCrop, RandomScale, IAAPiecewiseAffine, IAAAffine, IAAPerspective, \
LongestMaxSize, Resize, IAASharpen
import albumentations.augmentations.functional as F
from .conftest import skip_appveyor


def test_transpose_both_image_and_mask():
Expand Down Expand Up @@ -159,6 +160,7 @@ def __test_multiprocessing_support_proc(args):
[IAAPerspective, {}],
[IAASharpen, {}]
])
@skip_appveyor
def test_multiprocessing_support(augmentation_cls, params):
"""Checks whether we can use augmetnations in multi-threaded environments"""
aug = augmentation_cls(p=1, **params)
Expand Down

0 comments on commit 662bb94

Please sign in to comment.