-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
117 lines (92 loc) · 2.19 KB
/
setup.py
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import sys
from codecs import open
from setuptools import setup
def get_path(filename):
"""
Returns the absolute path to *filename* (a directory).
"""
return os.path.abspath(os.path.dirname(filename))
def get_meta(path=None):
"""
Returns a tuple of `__version__` and `__doc__` form the modul.
If *path* is set, it is temporarily added to `sys.path`.
"""
if path:
sys.path.insert(1, path)
from wdiffhtml import __version__, __doc__
if path:
del(sys.path[0])
return __version__, __doc__
def get_short_description(text):
"""
Returns the first paragraph from *text*.
"""
return [p.strip() for p in text.strip().split('\n\n')][0]
def get_long_description(filename):
"""
Returns the contents of *filename* (UTF-8).
"""
with open(filename, encoding='utf-8') as f:
return f.read()
VERSION, DOC = get_meta()
INSTALL_REQUIRES = [
'setuptools',
'jinja2',
'appdirs',
]
PY2_REQUIRES = [
'pathlib',
]
EXTRAS_REQUIRE = {
'test': [
'testfixtures',
'tox',
],
'dev': [
'bumpversion',
'invoke',
],
}
if sys.version_info < (3,):
INSTALL_REQUIRES.extend(PY2_REQUIRES)
setup(
name='wdiffhtml',
version=VERSION,
packages=['wdiffhtml'],
package_data={
'wdiffhtml': [
'data/template.jinja',
'data/styles.css',
'data/main.js',
'data/secondary.js',
]
},
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
description=get_short_description(DOC),
long_description=get_long_description('README.md'),
keywords='',
url='https://github.com/brutus/wdiffhtml',
author='Brutus [DMC]',
author_email='[email protected]',
license='GNU GPLv3',
classifiers=[
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 4 - Beta',
'Environment :: Console',
'Topic :: Text Processing',
'Topic :: Utilities',
],
entry_points={
'console_scripts': [
'wdiffhtml=wdiffhtml.cli:run_cli',
],
},
)