~ubuntu-branches/ubuntu/utopic/pytimechart/utopic

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Package Import Robot
  • Author(s): Varun Hiremath
  • Date: 2011-11-13 18:14:30 UTC
  • Revision ID: package-import@ubuntu.com-20111113181430-bg2ompukqunnyhtt
Tags: upstream-1.0.0~rc1
ImportĀ upstreamĀ versionĀ 1.0.0~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# Installs pyTimechart using setuptools
 
3
# Run:
 
4
#     python setup.py install
 
5
# to install the package from the source archive.
 
6
 
 
7
import os, sys
 
8
from setuptools import setup, find_packages
 
9
 
 
10
# get version from source code
 
11
version = [
 
12
    (line.split('=')[1]).strip().strip('"').strip("'")
 
13
    for line in open(os.path.join('timechart', 'window.py'))
 
14
    if line.startswith( '__version__' )
 
15
][0]
 
16
 
 
17
# get descriptions from documentation
 
18
DOCLINES = {"":[]}
 
19
current_part = ""
 
20
for line in open(os.path.join('docs',os.path.join('sources', 'index.rst'))):
 
21
    if line.startswith(".. DESC"):
 
22
        current_part = line[7:].strip()
 
23
        DOCLINES[current_part] = []
 
24
    else:
 
25
        DOCLINES[current_part].append(line.strip())
 
26
 
 
27
 
 
28
if __name__ == "__main__":
 
29
    # docs are only supposed to be generated by a few, so dont make it a hard dependancy
 
30
    if "build_sphinx" in sys.argv or "upload_sphinx" in sys.argv:
 
31
        extraArguments = {'setup_requires' : 'sphinx-pypi-upload>=0.2'}
 
32
    else:
 
33
        extraArguments = {}
 
34
    ### Now the actual set up call
 
35
    setup (
 
36
        name = DOCLINES["title"][1],
 
37
        classifiers = [ c.strip() for c in """\
 
38
                License :: OSI Approved :: BSD License
 
39
                Programming Language :: Python
 
40
                Topic :: Software Development :: Libraries :: Python Modules
 
41
                Operating System :: Microsoft :: Windows
 
42
                Operating System :: OS Independent
 
43
                Operating System :: POSIX
 
44
                Operating System :: Unix
 
45
                Intended Audience :: Developers
 
46
                """.splitlines() if len(c.strip()) > 0],
 
47
        keywords = 'gui,ftrace,perf,trace-event',
 
48
        version = version,
 
49
        url = "http://gitorious.org/pytimechart",
 
50
        download_url = "http://gitorious.org/pytimechart",
 
51
        description = DOCLINES["shortdesc"][1],
 
52
        long_description = '\n'.join(DOCLINES["longdesc"][1:]),
 
53
        author = "Pierre Tardy",
 
54
        author_email = "tardyp@gmail.com",
 
55
        install_requires = [
 
56
            'Chaco >= 3.0', # you should install that via distro rather than pypi..
 
57
            # 'pyliblzma >= 0.5' # not really mandatory
 
58
        ],
 
59
        license = "BSD",
 
60
        platforms = ["Windows", "Linux", "Mac OS-X", # actually did not manage to make it work on osx because of Traits..
 
61
                     "Unix", "Solaris"],
 
62
        namespace_packages = [
 
63
        'timechart',
 
64
        'timechart.plugins',
 
65
        'timechart.backends',
 
66
        ],
 
67
        packages = find_packages(exclude = [
 
68
        'examples',
 
69
        ]),
 
70
        package_data = {
 
71
            '': ['images/*'],
 
72
            },
 
73
 
 
74
        include_package_data = True,
 
75
        options = {
 
76
            'sdist':{
 
77
                'force_manifest':1,
 
78
                'formats':['gztar','zip'],},
 
79
        },
 
80
        zip_safe=False,
 
81
        entry_points = {
 
82
            'gui_scripts': [
 
83
                'pytimechart=timechart.timechart:main',
 
84
            ],
 
85
        },
 
86
        **extraArguments
 
87
    )
 
88