-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
86 lines (72 loc) · 2.51 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
"""Setup and install termdown
Addon for fabsetup (https://github.com/theno/fabsetup).
"""
import os
import os.path
from setuptools import setup, find_packages
from codecs import open
def create_readme_with_long_description():
'''Try to convert content of README.md into rst format using pypandoc,
write it into README and return it.
If pypandoc cannot be imported write content of README.md unchanged into
README and return it.
'''
this_dir = os.path.abspath(os.path.dirname(__file__))
readme_md = os.path.join(this_dir, 'README.md')
readme = os.path.join(this_dir, 'README')
if os.path.exists(readme_md):
# this is the case when running `python setup.py sdist`
if os.path.exists(readme):
os.remove(readme)
try:
import pypandoc
long_description = pypandoc.convert(readme_md, 'rst', format='md')
except(ImportError):
with open(readme_md, encoding='utf-8') as in_:
long_description = in_.read()
with open(readme, 'w') as out:
out.write(long_description)
else:
# this is in case of `pip install fabsetup-x.y.z.tar.gz`
with open(readme, encoding='utf-8') as in_:
long_description = in_.read()
return long_description
this_dir = os.path.abspath(os.path.dirname(__file__))
filename = os.path.join(this_dir, 'fabsetup_theno_termdown', '_version.py')
with open(filename, 'rt') as fh:
version = fh.read().split('"')[1]
description = __doc__.split('\n')[0]
long_description = create_readme_with_long_description()
setup(
name='fabsetup-theno-letsencrypt',
version=version,
description=description,
long_description=long_description,
url='https://github.com/theno/fabsetup-theno-letsencrypt',
author='Theodor Nolte',
author_email='theno@gmx.net',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
keywords='python development utilities library',
packages=find_packages(exclude=[
'contrib',
'docs',
'tests',
]),
include_package_data=True,
install_requires=[
'fabric',
'fabsetup',
],
extras_require={
'dev': ['pypandoc'],
}
)