-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·82 lines (76 loc) · 2.3 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
FormatBlock Setup
-Christopher Welborn 12-09-2016
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Try using the latest DESC.txt.
shortdesc = ' '.join((
'Format blocks of characters for display,',
'split by words, characters, or newlines.',
))
try:
with open('DESC.txt', 'r') as f:
shortdesc = f.read()
except FileNotFoundError:
pass
# Default README files to use for the longdesc, if pypandoc fails.
readmefiles = ('docs/README.txt', 'README.txt', 'docs/README.rst')
for readmefile in readmefiles:
try:
with open(readmefile, 'r') as f:
# Use previously converted README.
longdesc = f.read()
break
except EnvironmentError:
# File not found or failed to read.
pass
else:
# No readme file found.
# If a README.md exists, and pypandoc is installed, generate a new readme.
try:
import pypandoc
except ImportError:
print('Pypandoc not installed, using default description.')
longdesc = shortdesc
else:
# Convert using pypandoc.
try:
longdesc = pypandoc.convert('README.md', 'rst')
except EnvironmentError:
# No readme file, no fresh conversion.
print('Pypandoc readme conversion failed, using default desc.')
longdesc = shortdesc
setup(
name='FormatBlock',
version='0.4.1',
author='Christopher Welborn',
author_email='[email protected]',
packages=['fmtblock'],
url='https://github.com/welbornprod/fmtblock',
description=shortdesc,
long_description=longdesc,
keywords=('python module library 3 format block characters chars text'),
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules'
],
install_requires=[
'docopt',
'colr >= 0.5.1',
],
entry_points={
'console_scripts': [
'fmtblock = fmtblock.__main__:main',
]
}
)