-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·82 lines (76 loc) · 2.24 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 -*-
"""
WhichFile Setup
-Christopher Welborn 03-21-2020
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Try using the latest DESC.txt.
shortdesc = 'Reports symlink targets and file types, like `which` and `file`.'
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:
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='WhichFile',
version='1.0.3',
author='Christopher Welborn',
author_email='[email protected]',
packages=['whichfile'],
url='https://github.com/welbornprod/whichfile',
description=shortdesc,
long_description=longdesc,
keywords=('python python3 2 3 which file whichfile tool executable'),
classifiers=[
' :: '.join((
'License',
'OSI Approved',
'GNU General Public License v2 or later (GPLv2+)',
)),
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only'
],
install_requires=[
'colr>=0.9.1',
'docopt>=0.6.2',
'findfunc>=0.4.5',
'formatblock>=0.3.6',
'python-magic>=0.4.15',
],
entry_points={
'console_scripts': [
'whichfile = whichfile.__main__:entry_point',
],
},
)