summaryrefslogtreecommitdiff
path: root/setup.py
blob: da849e5664c042e287732644a37a4c88967c9d33 (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
#!/usr/bin/env python
import os
import re
import io
import sys
from setuptools import setup, find_packages

here = os.path.dirname(__file__)


def read(filename):
    with io.open(os.path.join(here, filename), 'r', encoding='utf-8') as f:
        return f.read()


metadata = dict(
    (k, eval(v)) for k, v in
    re.findall('^(__version__|__author__|__url__|__licence__) = (.*)$',
               read('src/gtimelog/__init__.py'), flags=re.MULTILINE)
)

version = metadata['__version__']

changes = read('CHANGES.rst').split('\n\n\n')
changes_in_latest_versions = '\n\n\n'.join(changes[:3])
older_changes = '''
Older versions
~~~~~~~~~~~~~~

See the `full changelog`_.

.. _full changelog: https://github.com/gtimelog/gtimelog/blob/master/CHANGES.rst
'''

short_description = 'A Gtk+ time tracking application'
long_description = (
    read('README.rst') +
    '\n\n' +
    changes_in_latest_versions +
    '\n\n' +
    older_changes
)

tests_require = ['freezegun']
if sys.version_info < (3,):
    # Python 2 doesn't have unittest.mock
    tests_require.append('mock')

setup(
    name='gtimelog',
    version=version,
    author='Marius Gedminas',
    author_email='marius@gedmin.as',
    url='https://gtimelog.org/',
    description=short_description,
    long_description=long_description,
    license='GPL',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: X11 Applications :: GTK',
        'License :: OSI Approved :: GNU General Public License (GPL)',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Topic :: Office/Business',
    ],

    packages=find_packages('src'),
    package_dir={'': 'src'},
    include_package_data=True,
    package_data={'': ['locale/*/LC_MESSAGES/gtimelog.mo']},
    test_suite='gtimelog.tests',
    tests_require=tests_require,
    extras_require={
        'test': [
            'freezegun',
        ],
        'test:python_version == "2.7"': [
            'mock',
        ],
    },
    zip_safe=False,
    entry_points="""
    [gui_scripts]
    gtimelog = gtimelog.main:main
    """,
    install_requires=['PyGObject'],
)