From dadb8f1ff65ba1e609e2cb11b56c0b4cbd03ead4 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Sun, 10 Apr 2016 19:42:24 +0200 Subject: [PATCH] Add tox configuration and integration with setup.py Add Travis CI build server configuration Add badges and Tests section to README Bump version (development) --- .gitignore | 2 ++ .travis.yml | 5 +++++ README.rst | 39 ++++++++++++++++++++++++++++++++++---- setup.cfg | 2 +- setup.py | 49 ++++++++++++++++++++++++++++++++++++++++-------- todo/__init__.py | 6 ++++-- tox.ini | 18 ++++++++++++++++++ 7 files changed, 106 insertions(+), 15 deletions(-) create mode 100644 .travis.yml create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 5f1d4d5..9ae827f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # tools, IDEs, build folders /.coverage/ +/.eggs/ /.idea/ +/.tox/ /build/ /dist/ /docs/build/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0e6a36b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: python +install: + - pip install virtualenv +script: + - python setup.py test diff --git a/README.rst b/README.rst index 4da4741..8e255d8 100644 --- a/README.rst +++ b/README.rst @@ -1,9 +1,11 @@ -=========== -django todo -=========== +============================ +django todo |latest-version| +============================ + +|build-status| |health| |downloads| |license| django-todo is a pluggable multi-user, multi-group task management and -assignment application for Django. It can serve as anything from a personal +assignment application for Django. It can serve as anything from a personal to-do system to a complete, working ticketing system for organizations. Documentation @@ -19,3 +21,32 @@ For documentation, see the django-todo wiki pages: - `Version history `_ + +Tests +===== + +Serious tests are missing, but we're checking PEP8 conformity of our syntax on +both Python 2 and 3 using ``tox``. You can run the tests locally via:: + + $ python setup.py test + +No prerequisites are required, all test dependencies will be installed +automatically by ``tox`` in virtual environments created on the fly. +Unfortunately, you'll have to install ``virtualenv`` for this to work, though. + + +.. |latest-version| image:: https://img.shields.io/pypi/v/django-todo.svg + :alt: Latest version on PyPI + :target: https://pypi.python.org/pypi/django-todo +.. |build-status| image:: https://travis-ci.org/shacker/django-todo.svg + :alt: Build status + :target: https://travis-ci.org/shacker/django-todo +.. |health| image:: https://landscape.io/github/shacker/django-todo/master/landscape.svg?style=flat + :target: https://landscape.io/github/shacker/django-todo/master + :alt: Code health +.. |downloads| image:: https://img.shields.io/pypi/dm/django-todo.svg + :alt: Monthly downloads from PyPI + :target: https://pypi.python.org/pypi/django-todo +.. |license| image:: https://img.shields.io/pypi/l/django-todo.svg + :alt: Software license + :target: https://github.com/shacker/django-todo/blob/master/LICENSE diff --git a/setup.cfg b/setup.cfg index 789b9c3..ed39ce3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,4 @@ [flake8] max-line-length = 120 max-complexity = 10 -exclude = build,dist,docs/conf.py,todo/migrations,*.egg-info +exclude = build,dist,docs/conf.py,*/migrations,*.egg-info diff --git a/setup.py b/setup.py index dcdd7bd..4bf0074 100755 --- a/setup.py +++ b/setup.py @@ -1,26 +1,59 @@ #!/usr/bin/env python from setuptools import setup, find_packages -import todo +from setuptools.command.test import test as TestCommand +import shlex +import sys + +import todo as package + + +class Tox(TestCommand): + user_options = [('tox-args=', 'a', "Arguments to pass to tox")] + + def initialize_options(self): + TestCommand.initialize_options(self) + self.tox_args = None + + def finalize_options(self): + TestCommand.finalize_options(self) + self.test_args = [] + self.test_suite = True + + def run_tests(self): + import tox + args = self.tox_args + if args: + args = shlex.split(self.tox_args) + errno = tox.cmdline(args=args) + sys.exit(errno) setup( name='django-todo', - version=todo.__version__, - description='A multi-user, multi-group task management and assignment system for Django.', - author=todo.__author__, - author_email=todo.__email__, - url=todo.__url__, - license=todo.__license__, + version=package.__version__, + description=package.__doc__.strip(), + author=package.__author__, + author_email=package.__email__, + url=package.__url__, + license=package.__license__, packages=find_packages(), classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', + 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Framework :: Django', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + 'Topic :: Office/Business :: Groupware', + 'Topic :: Software Development :: Bug Tracking', ], include_package_data=True, zip_safe=False, + tests_require=['tox'], + cmdclass={ + 'test': Tox, + }, ) diff --git a/todo/__init__.py b/todo/__init__.py index abfd735..e579e68 100644 --- a/todo/__init__.py +++ b/todo/__init__.py @@ -1,5 +1,7 @@ -"""django todo""" -__version__ = '1.5' +""" +A multi-user, multi-group task management and assignment system for Django. +""" +__version__ = '1.6.dev1' __author__ = 'Scot Hacker' __email__ = 'shacker@birdhouse.org' diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..9e7eeb5 --- /dev/null +++ b/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = + flake8py{2,3} + +[testenv] +# deps = pytest +commands = + # py.test + +[testenv:flake8py2] +basepython = python2.7 +deps = flake8 +commands = flake8 . + +[testenv:flake8py3] +basepython = python3.4 +deps = flake8 +commands = flake8 .