root/livinglogic.python.pycoco/setup.py @ 91:ce01f615d3d2

Revision 91:ce01f615d3d2, 2.3 KB (checked in by Walter Doerwald <walter@…>, 6 years ago)

Update to use Python 3.3 and XIST 4.10.

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
38hg
39mercurial
40test
41code coverage
42coverage
43"""
44
45try:
46    news = list(open("NEWS.rst", "r"))
47except IOError:
48    description = DESCRIPTION.strip()
49else:
50    # Extract the first section (which are the changes for the current version)
51    underlines = [i for (i, line) in enumerate(news) if line.startswith("---")]
52    news = news[underlines[0]-1:underlines[1]-1]
53    news = "".join(news)
54    descr = "%s\n\n\n%s" % (DESCRIPTION.strip(), news)
55
56    # Get rid of text roles PyPI doesn't know about
57    descr = re.subn(":[a-z]+:`([a-zA-Z0-9_.]+)`", "``\\1``", descr)[0]
58
59    # Expand tabs (so they won't show up as 8 spacces in the Windows installer)
60    descr = descr.expandtabs(2)
61
62
63args = dict(
64    name="pycoco",
65    version="0.8",
66    description="Python code coverage",
67    long_description=descr,
68    author="Walter Doerwald",
69    author_email="walter@livinglogic.de",
70    url="http://www.livinglogic.de/Python/pycoco/",
71    download_url="http://www.livinglogic.de/Python/Download.html#pycoco",
72    license="Python",
73    classifiers=sorted(set(c for c in CLASSIFIERS.strip().splitlines() if c.strip() and not c.strip().startswith("#"))),
74    keywords=", ".join(sorted(set(k.strip() for k in KEYWORDS.strip().splitlines() if k.strip() and not k.strip().startswith("#")))),
75    package_dir={"": "src"},
76    packages=["pycoco"],
77    package_data={
78        "": ["*.gif", "*.css", "*.js"],
79    },
80    entry_points=dict(
81        console_scripts=[
82            "pycoco = pycoco:main",
83        ]
84    ),
85    scripts=[
86        "scripts/pycoco",
87    ],
88    install_requires=[
89        "ll-xist == 4.10",
90    ],
91    zip_safe=False,
92)
93
94
95if __name__ == "__main__":
96    tools.setup(**args)
Note: See TracBrowser for help on using the browser.