From 0970e8b390d94499749386383dd93c362ad372a0 Mon Sep 17 00:00:00 2001 From: Phoenix Zerin Date: Sat, 14 Oct 2017 16:35:18 +1300 Subject: [PATCH 1/2] Added local unit test, alternate deploy strategy. --- .travis.yml | 13 ++++++++++--- MANIFEST.in | 3 +++ setup.py | 4 ++++ test/__init__.py | 3 +++ test/pyota_ccurl_test.py | 15 +++++++++++++++ 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 MANIFEST.in create mode 100644 test/__init__.py create mode 100644 test/pyota_ccurl_test.py diff --git a/.travis.yml b/.travis.yml index 3e3a1bf..83fbc01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,24 +6,31 @@ python: - '3.6' install: pip install --pre . script: + # Run local unit tests. + - python setup.py test + + # Install PyOTA unit tests and ensure tests still pass with the + # C extension installed. - pip install nose mock - 'pip download --no-deps --no-binary :all: --dest pyota-unittests --pre pyota' - tar -zxf pyota-unittests/PyOTA-*.tar.gz -C pyota-unittests --strip-components=1 - nosetests pyota-unittests/test deploy: + # Ensure a source distribution gets published, even if wheels fail. - on: tags: true python: '3.6' provider: pypi - distributions: 'bdist_wheel sdist' + distributions: sdist user: phx password: secure: uprcy4uI8nx4t6NVfyzAlr5L9JgomGg6ZJbhb0u7lRUuOHeCB9ETXrg6zSbwiBGKc3bnbnAIJvGGVJErAdsOd9x5p3oyZI8UPOj9nQCKX3FStIl0x10licad1X5lO2WlIGyJNlg+uncFr3sUCG4W4SqujmDsBQnsUBVG2ei0i9eLxxzQsp+gPPPlVw2OLlkJ40B6wO64XcIf6Zlzq4Z/7mvtH3fkczPBiS6UYEv1I1OEBUaZ/h1fsvsbnriMV3Li3hdt22kquEqSxwxBjMcJ9FRAuyhJZz/GNkeHLiLkDodR3VKHan5+jBsWH44+xriOxNVhGNdI84u0NmXz00Crs5WL7O83vjM8m1t3rK1uX+fiyG7WhClFov1Lk4/OqBBUg92rXKvj1h78tSW2ldlwN6pv2QrmpZtWLDZySSPPmkDKAEQoWBo6wuotltqO9EUwi8Y4MHaXafRJcT5OaqJLa12jJTWAyAauzrO7HbcrCLJetcb1KY+ouBw7agLw30juPgm3d35mNV2jWaU2FaYr/vTGuT/PLQMOgWWoGb0LzHcLhrrv7QIBM/LZX+an02DGNHRoV7qGF5w+OLAt8eZOMuAhesZ5HTOXWj5+IXGjAupaJ/9cOYnSM7OwUjXcOh7I/5dvx41wV6sxDuI0jiIqCN47ZpSyA33FnCpjfrs6wTM= + + # Upload a wheel for each version of Python. - on: tags: true - python: '2.7' provider: pypi - distributions: 'bdist_wheel' + distributions: bdist_wheel user: phx password: secure: uprcy4uI8nx4t6NVfyzAlr5L9JgomGg6ZJbhb0u7lRUuOHeCB9ETXrg6zSbwiBGKc3bnbnAIJvGGVJErAdsOd9x5p3oyZI8UPOj9nQCKX3FStIl0x10licad1X5lO2WlIGyJNlg+uncFr3sUCG4W4SqujmDsBQnsUBVG2ei0i9eLxxzQsp+gPPPlVw2OLlkJ40B6wO64XcIf6Zlzq4Z/7mvtH3fkczPBiS6UYEv1I1OEBUaZ/h1fsvsbnriMV3Li3hdt22kquEqSxwxBjMcJ9FRAuyhJZz/GNkeHLiLkDodR3VKHan5+jBsWH44+xriOxNVhGNdI84u0NmXz00Crs5WL7O83vjM8m1t3rK1uX+fiyG7WhClFov1Lk4/OqBBUg92rXKvj1h78tSW2ldlwN6pv2QrmpZtWLDZySSPPmkDKAEQoWBo6wuotltqO9EUwi8Y4MHaXafRJcT5OaqJLa12jJTWAyAauzrO7HbcrCLJetcb1KY+ouBw7agLw30juPgm3d35mNV2jWaU2FaYr/vTGuT/PLQMOgWWoGb0LzHcLhrrv7QIBM/LZX+an02DGNHRoV7qGF5w+OLAt8eZOMuAhesZ5HTOXWj5+IXGjAupaJ/9cOYnSM7OwUjXcOh7I/5dvx41wV6sxDuI0jiIqCN47ZpSyA33FnCpjfrs6wTM= diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..6aadfa3 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include LICENSE +include README.rst +recursive-include test *.py diff --git a/setup.py b/setup.py index d986721..c9c93d3 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,10 @@ install_requires = ['pyota'], + tests_require = ['nose'], + test_suite = 'test', + test_loader = 'nose.loader:TestLoader', + license = 'MIT', classifiers = [ diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..3f3d02d --- /dev/null +++ b/test/__init__.py @@ -0,0 +1,3 @@ +# coding=utf-8 +from __future__ import absolute_import, division, print_function, \ + unicode_literals diff --git a/test/pyota_ccurl_test.py b/test/pyota_ccurl_test.py new file mode 100644 index 0000000..57d60a5 --- /dev/null +++ b/test/pyota_ccurl_test.py @@ -0,0 +1,15 @@ +# coding=utf-8 +from __future__ import absolute_import, division, print_function, \ + unicode_literals + +from unittest import TestCase + +from pyota_ccurl import is_installed + + +class IsInstalledTestCase(TestCase): + def test_is_installed(self): + """ + Verify that the C extension is installed correctly. + """ + self.assertTrue(is_installed()) From 931adae7c752e9a312f7dfcf2619fc8fc6dbdc53 Mon Sep 17 00:00:00 2001 From: Phoenix Zerin Date: Sat, 14 Oct 2017 16:39:52 +1300 Subject: [PATCH 2/2] Bumping version number. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c9c93d3..2d84e6f 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ name = 'PyOTA-CCurl', description = 'C Curl extension for PyOTA', url = 'https://github.com/todofixthis/pyota-ccurl', - version = '1.0.7', + version = '1.0.8', long_description = long_description,