aboutsummaryrefslogtreecommitdiff
blob: 4a416315b31063fe200a216ff4f6603a4cb037ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"""
Project Grumpy
--------------

Project Grumpy is a an application and a set of utilities aimed to improve
life for Gentoo developers.

"""
import os, sys

from os.path import join
from setuptools import Command, setup

class cmd_Audit(Command):
    """Audits Grumpy's source code using PyFlakes for following issues:
        - Names which are used but not defined or used before they are defined.
        - Names which are redefined without having been used.
    """

    description = "Audit Grumpy's source with PyFlakes"
    user_options = []

    def initialize_options(self):
        all = None

    def finalize_options(self):
        pass

    def run(self):
        try:
            import pyflakes.scripts.pyflakes as flakes
        except ImportError:
            print "Audit requires PyFlakes installed in your system."""
            sys.exit(-1)

        dirs = ['grumpy', 'grumpy/testsuite', 'grumpy/vdb', 'utils']
        warns = 0
        for dir in dirs:
            for filename in os.listdir(dir):
                if filename.endswith('.py') and filename != '__init__.py':
                    warns += flakes.checkPath(os.path.join(dir, filename))
        if warns > 0:
            print ("Audit finished with total %d warnings." % warns)
        else:
            print ("No problems found in sourcecode.")

setup(
    name='Grumpy',
    version='0.0',
    url='http://git.overlays.gentoo.org/gitweb/?p=proj/grumpy.git;a=summary',
    license='BSD',
    author='Priit Laes',
    author_email='plaes@plaes.org',
    description='Set of QA helpers for Gentoo Developers',
    long_description=__doc__,
    packages=['grumpy'],
    scripts=[join('utils', 'grumpy_sync.py')],
    test_suite='grumpy.testsuite.suite',
    zip_safe=False,
    platforms='any',
    install_requires=[
        'Flask',
        'Flask-OpenID',
        'Flask-SQLAlchemy',
        'lxml',
        'pkgcore',
        'snakeoil',
        'SQLAlchemy >= 0.6',
    ],
    classifiers=[
        'Development Status :: 1 - Planning',
        'Environment :: Other Environment',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Quality Assurance',
        'Topic :: Utilities'
    ],
    cmdclass={'audit': cmd_Audit}
)