From 10f2b95e63b3abb6d69257c53c813dd2b38967a4 Mon Sep 17 00:00:00 2001 From: Steffen Allner Date: Thu, 9 Jan 2020 16:51:27 +0100 Subject: [PATCH 1/2] Activate travis and coverage. --- .coveragerc | 14 +++++++++++ .travis.yml | 17 ++++++++++++++ CHANGES.txt => CHANGES.rst | 0 README.txt => README.rst | 0 js/jquery_datatables_plugins/__init__.py | 6 ++--- ...txt => test_jquery_datatables_plugins.rst} | 0 setup.py | 23 +++++++++++-------- tox.ini | 12 ++++++++++ 8 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 .coveragerc create mode 100644 .travis.yml rename CHANGES.txt => CHANGES.rst (100%) rename README.txt => README.rst (100%) rename js/jquery_datatables_plugins/{test_jquery_datatables_plugins.txt => test_jquery_datatables_plugins.rst} (100%) create mode 100644 tox.ini diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..d4e1d8b --- /dev/null +++ b/.coveragerc @@ -0,0 +1,14 @@ +[run] +branch = True +source = js.smoke + +[report] +precision = 2 + +[html] +directory = coverage-report + +[paths] +source = + js/smoke + .tox/*/lib/python*/site-packages/js/smoke diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0afee9d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: python +dist: xenial +python: + - 2.7 + - 3.8 +install: pip install tox-travis coveralls +script: tox +after_success: + - coverage combine + - coveralls +cache: + pip: true + directories: + - eggs/ +notifications: + webhooks: + secure: RitAJa3um97pEvDgpavZtqALpo1889LLDlZ0lWLGv7sUQ8mPVhPChoF5YOc7HohVxmoLa+wW9xAKS+04RNqBnc3BbnTHw7i1GG34EcBjm9uJl/E8NjHLUDN5bronS7jK37kggvX7TbCVferfXu+C2+ikmx/WX9Sq3sho7KRo2zQquSbfkK8EtIt2FVTlh31pcchqvWfL7PYk4BjzsdWlHRJQYAhNxpoDLvw5a7Se1gx9AbyrgdZ7JoEEIUv4+9EeJr3zB9WQyTBNiYF6/clq+k/Y2kaSmZeTZJlNI0/R/Y2Gz5BFiIU6nbMQQZ7P6Y4GSouzcEewAfvtX1SUEnyRdmebFIBBVUoAKZ6xaK5+pcsVELHYDMqGa+YCVf3lKyXbWUWauAeF6hsXmLsFv1qpyFuC+AKIxF7DEss7mUvZ0kuz2wvPWiUHhQAPvvIJv+LeoaMP09Do4fUdPtBjW3oWwDbXoNWnzfP2JLIK4AIZ1Tv2A687fooSMbi+c+bBXL1ZaawIUPSnuR2TqUrIs4fkyDkv/ZAw6Xf4DBVjLFwiu/y8TbooeGvpf5WZ9/3MRyjqsd9sdJskZWm3rqbzYBUUEltpXeMmf+YcjcIYdS2rlQk5IOTk/5N4Us3TOMpddW2xRiCdYLfoy8wCVXXTmxiTfGbydgtM+lT51InZcTAhhnw= diff --git a/CHANGES.txt b/CHANGES.rst similarity index 100% rename from CHANGES.txt rename to CHANGES.rst diff --git a/README.txt b/README.rst similarity index 100% rename from README.txt rename to README.rst diff --git a/js/jquery_datatables_plugins/__init__.py b/js/jquery_datatables_plugins/__init__.py index 7ebd2a9..3a49fdc 100644 --- a/js/jquery_datatables_plugins/__init__.py +++ b/js/jquery_datatables_plugins/__init__.py @@ -1,11 +1,9 @@ from fanstatic import Library, Resource -from js.jquery import jquery -from js.jquery_datatables import jquery_datatables_js +from js.jquery_datatables import datatables_js library = Library('jquery_datatables_plugins', 'resources') column_filter = Resource( library, 'columnfilter/media/js/jquery.dataTables.columnFilter.js', - depends=[jquery_datatables_js], + depends=[datatables_js], minified='columnfilter/media/js/jquery.dataTables.columnFilter.min.js') - diff --git a/js/jquery_datatables_plugins/test_jquery_datatables_plugins.txt b/js/jquery_datatables_plugins/test_jquery_datatables_plugins.rst similarity index 100% rename from js/jquery_datatables_plugins/test_jquery_datatables_plugins.txt rename to js/jquery_datatables_plugins/test_jquery_datatables_plugins.rst diff --git a/setup.py b/setup.py index 814346d..a4c433a 100644 --- a/setup.py +++ b/setup.py @@ -10,16 +10,20 @@ version = '1.9.4-1.dev0' + def read(*rnames): - return open(os.path.join(os.path.dirname(__file__), *rnames)).read() + """Read file content.""" + with open(os.path.join(os.path.dirname(__file__), *rnames))as f: + return f.read() + long_description = ( - read('README.txt') + read('README.rst') + '\n' + read('js', 'jquery_datatables_plugins', - 'test_jquery_datatables_plugins.txt') + 'test_jquery_datatables_plugins.rst') + '\n' + - read('CHANGES.txt')) + read('CHANGES.rst')) setup( name='js.jquery_datatables_plugins', @@ -31,7 +35,8 @@ def read(*rnames): author='Danie. Havlik', author_email='dh@gocept.com', license='BSD', - packages=find_packages(),namespace_packages=['js'], + packages=find_packages(), + namespace_packages=['js'], include_package_data=True, zip_safe=False, install_requires=[ @@ -39,10 +44,10 @@ def read(*rnames): 'setuptools', 'js.jquery', 'js.jquery_datatables' - ], + ], entry_points={ 'fanstatic.libraries': [ 'jquery_datatables_plugins = js.jquery_datatables_plugins:library', - ], - }, - ) + ], + }, +) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..6979c36 --- /dev/null +++ b/tox.ini @@ -0,0 +1,12 @@ +[tox] +envlist = + py27, + py38, + +[testenv] +deps = + py27: pytest < 5.0 + !py27: pytest + pytest-cov +commands = py.test --doctest-glob='*.rst' --cov js {posargs} +usedevelop = True From 72194ecfc4cd5ac9e63161b358013194a7426536 Mon Sep 17 00:00:00 2001 From: Steffen Allner Date: Fri, 10 Jan 2020 09:36:26 +0100 Subject: [PATCH 2/2] This breaks locally but might help on travis. --- js/jquery_datatables_plugins/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/jquery_datatables_plugins/__init__.py b/js/jquery_datatables_plugins/__init__.py index 3a49fdc..4a29658 100644 --- a/js/jquery_datatables_plugins/__init__.py +++ b/js/jquery_datatables_plugins/__init__.py @@ -1,9 +1,9 @@ from fanstatic import Library, Resource -from js.jquery_datatables import datatables_js +from js.jquery_datatables import jquery_datatables_js library = Library('jquery_datatables_plugins', 'resources') column_filter = Resource( library, 'columnfilter/media/js/jquery.dataTables.columnFilter.js', - depends=[datatables_js], + depends=[jquery_datatables_js], minified='columnfilter/media/js/jquery.dataTables.columnFilter.min.js')