From 66a4adc32970c61a20ab0b8a8314dcc232c9e84d Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Tue, 28 Aug 2018 19:49:02 -0500 Subject: [PATCH 1/4] Setup Travis CI for testing code automatically Want to have Travis CI also automatically deploy to PyPi as well. Still working on that. --- .travis.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7e61b35 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: python + +python: + - 3.6 + +# Command to install dependencies +install: pip install -r requirements.txt + +# Command to run tests +script: python tests/test_polarTransform.py + +# Command to deploy releases to PyPi +#deploy: +# provider: pypi +# distributions: sdist bdist_wheel +# user: addisonElliott +## password: +## secure: Fbmpr40Cyg9mh6J+iikjNiA6APT04MTPERAXGd6C/aP9lyoln9UOJXzSWtaJn8vZ5S5LRYJqGJXc0QINxLWq2qe4AC/7iZUIOQlygI6UTOTMNh8bf7+fqH0+b5w5kB7U+VEVLp329dvgjYBSV3Vd3fYZexqa+b9NZzrZarucFDcle1+TPmlkLHJAu+jxR4jrjrZe4yLQB7lr4iar6Vk/+aiQxQnMiaw/PzWbp9oGL4eZUjy3h/UajH8XF8umyLKgv4picpcxxskmAdNSK19Sa1JjKVMwo3JFc7wHaRZ61SCAf4BXqpBKHz6YMRy9QXwkOF0vLqGcF7/0b55C65aByGd0f1vQG1gZpDvq2ulnWFEzP77jQGfIBP/br8cCfncZhQVthGZVXZf38wrtH5WuX5UzjUNGl1lEYe2aV+/zeSHxul8NGk6TNGz+xHnQQqfqfM8F+suWvHoxK5dkebOuwmyz3UxWJskHdE2pidmVQJ6f2KlbrGUD0BlYpHibBCpIOkJ7QDLBk+VpLTMllDN8rrtW+weSAI5qWCTHtXZ1adlaeTW9YlLQ5hGqHJY8Gc1sefq8IYoOaJrCL6tC4+el/z456I8hcnpxg/j59TjnnkmLQcyGMpuUupjaIlQvVJKkkGCtmks2jbUqtS0KIbXNMm3QuqskTdwuxd7fHqCN5dY= +# on: +# tags: true \ No newline at end of file From 6ef1aaec1283ec479ca52a8c5f4327ac01d0e219 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Tue, 28 Aug 2018 20:08:21 -0500 Subject: [PATCH 2/4] Fix issues with tests running --- requirements.txt | 3 ++- tests/test_polarTransform.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index dc9c5ca..05c015f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ numpy scipy scikit-image -numpydoc \ No newline at end of file +numpydoc +imageio \ No newline at end of file diff --git a/tests/test_polarTransform.py b/tests/test_polarTransform.py index bf08045..3a31f91 100644 --- a/tests/test_polarTransform.py +++ b/tests/test_polarTransform.py @@ -1,12 +1,13 @@ import unittest import numpy as np -import polarTransform import sys import os -sys.path.append(os.path.dirname(os.path.abspath(__file__))) +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from util import loadImage, assert_image_equal +import polarTransform + class TestPolarConversion(unittest.TestCase): def setUp(self): From 8a125370027784ebcba41aafe5786a934e3e5909 Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Tue, 28 Aug 2018 20:11:10 -0500 Subject: [PATCH 3/4] Remove unused images that cause tests to fail --- tests/test_polarTransform.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/test_polarTransform.py b/tests/test_polarTransform.py index 3a31f91..885fd4e 100644 --- a/tests/test_polarTransform.py +++ b/tests/test_polarTransform.py @@ -1,7 +1,8 @@ +import os +import sys import unittest + import numpy as np -import sys -import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from util import loadImage, assert_image_equal @@ -13,8 +14,6 @@ class TestPolarConversion(unittest.TestCase): def setUp(self): self.shortAxisApexImage = loadImage('shortAxisApex.png') self.verticalLinesImage = loadImage('verticalLines.png') - # self.horizontalLinesImage = loadImage('horizontalLines.png') - # self.checkerboardImage = loadImage('checkerboard.png') self.shortAxisApexPolarImage = loadImage('shortAxisApexPolarImage.png') self.shortAxisApexPolarImage_centerMiddle = loadImage('shortAxisApexPolarImage_centerMiddle.png') @@ -159,8 +158,6 @@ class TestCartesianConversion(unittest.TestCase): def setUp(self): self.shortAxisApexImage = loadImage('shortAxisApex.png') self.verticalLinesImage = loadImage('verticalLines.png') - # self.horizontalLinesImage = loadImage('horizontalLines.png') - # self.checkerboardImage = loadImage('checkerboard.png') self.shortAxisApexPolarImage = loadImage('shortAxisApexPolarImage.png') self.shortAxisApexPolarImage_centerMiddle = loadImage('shortAxisApexPolarImage_centerMiddle.png') @@ -355,8 +352,6 @@ class TestPolarAndCartesianConversion(unittest.TestCase): def setUp(self): self.shortAxisApexImage = loadImage('shortAxisApex.png') self.verticalLinesImage = loadImage('verticalLines.png') - # self.horizontalLinesImage = loadImage('horizontalLines.png') - # self.checkerboardImage = loadImage('checkerboard.png') self.shortAxisApexPolarImage = loadImage('shortAxisApexPolarImage.png') self.shortAxisApexPolarImage_centerMiddle = loadImage('shortAxisApexPolarImage_centerMiddle.png') @@ -441,8 +436,6 @@ class TestPointConversion(unittest.TestCase): def setUp(self): self.shortAxisApexImage = loadImage('shortAxisApex.png') self.verticalLinesImage = loadImage('verticalLines.png') - # self.horizontalLinesImage = loadImage('horizontalLines.png') - # self.checkerboardImage = loadImage('checkerboard.png') self.shortAxisApexPolarImage = loadImage('shortAxisApexPolarImage.png') self.shortAxisApexPolarImage_centerMiddle = loadImage('shortAxisApexPolarImage_centerMiddle.png') From e5926db03d04c030cda7463b2e2bdfa6a495263b Mon Sep 17 00:00:00 2001 From: Addison Elliott Date: Tue, 28 Aug 2018 20:22:58 -0500 Subject: [PATCH 4/4] Add auto-deploy option to PyPi --- .travis.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e61b35..940af30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,13 @@ language: python - python: - - 3.6 - -# Command to install dependencies +- 3.6 install: pip install -r requirements.txt - -# Command to run tests script: python tests/test_polarTransform.py - -# Command to deploy releases to PyPi -#deploy: -# provider: pypi -# distributions: sdist bdist_wheel -# user: addisonElliott -## password: -## secure: Fbmpr40Cyg9mh6J+iikjNiA6APT04MTPERAXGd6C/aP9lyoln9UOJXzSWtaJn8vZ5S5LRYJqGJXc0QINxLWq2qe4AC/7iZUIOQlygI6UTOTMNh8bf7+fqH0+b5w5kB7U+VEVLp329dvgjYBSV3Vd3fYZexqa+b9NZzrZarucFDcle1+TPmlkLHJAu+jxR4jrjrZe4yLQB7lr4iar6Vk/+aiQxQnMiaw/PzWbp9oGL4eZUjy3h/UajH8XF8umyLKgv4picpcxxskmAdNSK19Sa1JjKVMwo3JFc7wHaRZ61SCAf4BXqpBKHz6YMRy9QXwkOF0vLqGcF7/0b55C65aByGd0f1vQG1gZpDvq2ulnWFEzP77jQGfIBP/br8cCfncZhQVthGZVXZf38wrtH5WuX5UzjUNGl1lEYe2aV+/zeSHxul8NGk6TNGz+xHnQQqfqfM8F+suWvHoxK5dkebOuwmyz3UxWJskHdE2pidmVQJ6f2KlbrGUD0BlYpHibBCpIOkJ7QDLBk+VpLTMllDN8rrtW+weSAI5qWCTHtXZ1adlaeTW9YlLQ5hGqHJY8Gc1sefq8IYoOaJrCL6tC4+el/z456I8hcnpxg/j59TjnnkmLQcyGMpuUupjaIlQvVJKkkGCtmks2jbUqtS0KIbXNMm3QuqskTdwuxd7fHqCN5dY= -# on: -# tags: true \ No newline at end of file +deploy: + provider: pypi + distributions: sdist bdist_wheel + user: addisonElliott + on: + tags: true + password: + secure: F0Xx96xWhRdtfD3kSywX4VqF2VbZst85Wy0AsI8774OeN3e2712lgQyRp1sBp4AZzsYWowKg4/kFNljvJtko56Ag+ulwLieP9K+idWj4kc62BKCBMfsTEhHWicAla3mnlfIQGMIvD9En7CUPAiu5Bs+wj8kto2LRwv2lztSKBN8fk56r9zTd7f6Ft8MOoZqXZ8cpQNv610BvsY61s/u2RnaDkcI75LyztPCGIQ3O1wYnZWNebslif9QMsygHvsSFxoomOhM/MjRvsvEwpzDapKdaQ7xYf9uBfw40/XG/9xL0JqAjXpbKNltxFaPkshVgDBt+xMStyYV2nd5LClPrYYpSBHeFtL+HsO/lnUksBs09GwLQFw0TYfed0E28seMeb6zTSlnFQF2VnxVWu1Vqe1uriMmSH/0iKaes6ucQZ6Oag22ub3mtABz855kQ5FtkVW2eK8MG8FoFoxi6x+9e+YN0BG9A2NsNlNvur+nzx5XTduGVs+REAHURZ/56WG8IsKqOpRrNHPL5cK3+FBwCnAZVwkR5cT9K4pKtJBiL4h0aJzPTi3F4MCSns2vMbLSMQMBHVBey+lmReOZ9GH7uzS3KOZa+5LJLEFkvQjb3N3X7znn0oJO7s/aSsW2bzjrRhsYPYoLvSkcPqmyswowesB/SrKzX3vzvgBT9DFsCAHI=