aboutsummaryrefslogtreecommitdiff
path: root/pavement.py
blob: b8801835d2da17bb434f39e5b08268c3c29000eb (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (C) 2010  Leonard Thomas
#
# This file is part of Dodai.
#
# Dodai is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Dodai is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Dodai.  If not, see <http://www.gnu.org/licenses/>.

PACKAGE = 'dodai'
LICENSE='GPLv3'
VERSION = '0.3'
AUTHOR='Leonard Thomas'
AUTHOR_EMAIL='six@choushi.net'
URL='http://code.google.com/p/dodai'
DOWNLOAD_URL = 'http://code.google.com/p/dodai/downloads/list'
PY_VERSION_LOW = '2.6.0'
PY_VERSION_HIGH = '3.0.0'
PLATFORMS = ['Linux']
SETUP_REQUIRES=['sqlalchemy', 'chardet']
CLASSIFIERS = [
    'Development Status :: 4 - Beta',
    'Environment :: Console',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: GNU Affero General Public License v3',
    'Natural Language :: English',
    'Operating System :: POSIX',
    'Operating System :: POSIX :: Linux',
    'Programming Language :: Python',
    'Programming Language :: Python :: 2.6',
    'Topic :: Database',
    'Topic :: Software Development',
    'Topic :: Software Development :: Libraries',
    'Topic :: Software Development :: Libraries :: Application Frameworks',
    'Topic :: Software Development :: Libraries :: Python Modules',]
DESCRIPTION = 'Tools for writing python scripts'
LONG_DESCRIPTION = "This module is to be a foundation to your command line "\
    "python scripts. This module provides for quick access to logger, "\
    "configparser, optionparse and databases via sqlalchemy."\



import sys
import platform
import paver
import paver.setuputils
from paver.easy import options
from paver.easy import Bunch
from paver.easy import task
from paver.easy import needs
from paver.misctasks import generate_setup
from paver.misctasks import minilib
from setuptools import setup
from setuptools import find_packages

#from paver.easy import *
#from paver.misctasks import generate_setup, minilib
#from setuptools import setup, find_packages
#import paver.setuputils
paver.setuputils.install_distutils_tasks()

options(
    setup=Bunch(
    name=PACKAGE,
    version=VERSION,
    zip_safe=False,
    description=DESCRIPTION,
    author=AUTHOR,
    author_email=AUTHOR_EMAIL,
    url=URL,
    download_url=DOWNLOAD_URL,
    packages=find_packages(),
    classifiers=CLASSIFIERS,
    long_description=LONG_DESCRIPTION,
    license=LICENSE,
    setup_requires=SETUP_REQUIRES,
    install_requires=['sqlalchemy', 'chardet'],
    platforms = PLATFORMS

))


def is_valid_version():
    if sys.version >= PY_VERSION_LOW and sys.version < PY_VERSION_HIGH:
        return True
    else:
        return False

def is_valid_platform():
    if platform.system() in PLATFORMS:
        return True
    else:
        return False

@task
def build():
    if not is_valid_version():
        raise Exception('Invalid Python version')
    if not is_valid_platform():
        error='{0} not install on: {1}'.format(PACKAGE, platform.system())
        raise Exception(error)


@task
@needs('build', 'generate_setup', 'minilib', 'setuptools.command.sdist')
def sdist():
    """Overrides sdist to make sure that our setup.py is generated."""
    pass