-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·74 lines (68 loc) · 2.11 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Colr Setup
-Christopher Welborn 8-14-2015
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Try using the latest DESC.txt.
shortdesc = 'Easy terminal colors, with chainable methods.'
try:
with open('DESC.txt', 'r') as f:
shortdesc = f.read().strip()
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:
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='Colr',
version='0.9.2',
author='Christopher Welborn',
author_email='[email protected]',
packages=['colr'],
url='https://github.com/welbornprod/colr',
description=shortdesc,
long_description=longdesc,
keywords=('python module library 2 3 terminal escape codes color'),
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules'
],
entry_points={
'console_scripts': [
'colr = colr.__main__:entry_point',
'colr-run = colr.colr_run:entry_point',
]
}
)