root/livinglogic.python.pycoco/setup.py @ 88:1ac3f066127c

Revision 88:1ac3f066127c, 2.3 KB (checked in by Walter Doerwald <walter@…>, 9 years ago)

Port to XIST 3.15.3 and make the script runnable with "python -m".

Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Setup script for pycoco
5
6
7import re
8
9try:
10    import setuptools as tools
11except ImportError:
12    from distutils import core as tools
13
14
15DESCRIPTION = """pycoco is a script that can be used to generate code
16coverage info for the Python source code.
17
18The script downloads the Python source code, builds the interpreter
19with code coverage options, runs the test suite and generates an HTML
20report how often each source code line in each C or Python file has been
21executed by the test suite.
22"""
23
24
25CLASSIFIERS="""
26Development Status :: 4 - Beta
27Intended Audience :: Developers
28License :: OSI Approved :: Python License (CNRI Python License)
29Operating System :: OS Independent
30Programming Language :: Python
31Topic :: Software Development :: Testing
32"""
33
34
35KEYWORDS = """
36Python
37source code
38subversion
39test
40code coverage
41coverage
42"""
43
44try:
45    news = list(open("NEWS.rst", "r"))
46except IOError:
47    description = DESCRIPTION.strip()
48else:
49    # Extract the first section (which are the changes for the current version)
50    underlines = [i for (i, line) in enumerate(news) if line.startswith("---")]
51    news = news[underlines[0]-1:underlines[1]-1]
52    news = "".join(news)
53    descr = "%s\n\n\n%s" % (DESCRIPTION.strip(), news)
54
55    # Get rid of text roles PyPI doesn't know about
56    descr = re.subn(":[a-z]+:`([a-zA-Z0-9_.]+)`", "``\\1``", descr)[0]
57
58    # Expand tabs (so they won't show up as 8 spacces in the Windows installer)
59    descr = descr.expandtabs(2)
60
61
62args = dict(
63    name="pycoco",
64    version="0.8",
65    description="Python code coverage",
66    long_description=descr,
67    author=u"Walter Doerwald",
68    author_email="walter@livinglogic.de",
69    url="http://www.livinglogic.de/Python/pycoco/",
70    download_url="http://www.livinglogic.de/Python/Download.html#pycoco",
71    license="Python",
72    classifiers=sorted(set(c for c in CLASSIFIERS.strip().splitlines() if c.strip() and not c.strip().startswith("#"))),
73    keywords=", ".join(sorted(set(k.strip() for k in KEYWORDS.strip().splitlines() if k.strip() and not k.strip().startswith("#")))),
74    package_dir={"": "src"},
75    packages=["pycoco"],
76    package_data={
77        "": ["*.gif", "*.css", "*.js"],
78    },
79    entry_points=dict(
80        console_scripts=[
81            "pycoco = pycoco:main",
82        ]
83    ),
84    scripts=[
85        "scripts/pycoco",
86    ],
87    install_requires=[
88        "ll-xist >= 3.15",
89    ],
90    zip_safe=False,
91)
92
93
94if __name__ == "__main__":
95    tools.setup(**args)
Note: See TracBrowser for help on using the browser.