summaryrefslogtreecommitdiff
path: root/setup.py
blob: ea8edf28b6d7221c8109928adc84f9be3047d3c1 (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
#!/usr/bin/env python3

import os.path
from setuptools import setup


def _get_version_from_file(filename, start_of_line, split_marker):
    """Extract version from file, giving last matching value or None"""
    try:
        return [
            x for x in open(filename) if x.startswith(start_of_line)
        ][-1].split(split_marker)[1].strip()
    except (IOError, IndexError):
        return None


VERSION = (
    # Assume we are in a distribution, which has PKG-INFO
    _get_version_from_file('PKG-INFO', 'Version:', ':')
    # Must be a development checkout, so use the Makefile
    or _get_version_from_file('Makefile', 'VERSION', '=')
    or "0.0"
)


relpath = os.path.dirname(__file__)
if relpath:
    os.chdir(relpath)

setup(
    name='python-subunit',
    version=VERSION,
    description=('Python implementation of subunit test streaming protocol'),
    long_description=open('README.rst').read(),
    classifiers=[
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: 3.10',
        'Topic :: Software Development :: Testing',
    ],
    keywords='python test streaming',
    author='Robert Collins',
    author_email='subunit-dev@lists.launchpad.net',
    url='http://launchpad.net/subunit',
    license='Apache-2.0 or BSD',
    project_urls={
        "Bug Tracker": "https://bugs.launchpad.net/subunit",
        "Source Code": "https://github.com/testing-cabal/subunit/",
    },
    packages=['subunit', 'subunit.tests'],
    package_dir={'subunit': 'python/subunit'},
    scripts=[
        'filters/subunit-1to2',
        'filters/subunit-2to1',
        'filters/subunit-filter',
        'filters/subunit-ls',
        'filters/subunit-notify',
        'filters/subunit-output',
        'filters/subunit-stats',
        'filters/subunit-tags',
        'filters/subunit2csv',
        'filters/subunit2disk',
        'filters/subunit2gtk',
        'filters/subunit2junitxml',
        'filters/subunit2pyunit',
        'filters/tap2subunit',
    ],
    python_requires=">=3.6",
    install_requires=[
        'extras',
        'testtools>=0.9.34',
    ],
    tests_require=[
        'fixtures',
        'hypothesis',
        'testscenarios',
    ],
    extras_require={
        'docs': ['docutils'],
        'test': ['fixtures', 'testscenarios', 'hypothesis'],
    },
)