-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathsetup.py
63 lines (56 loc) · 1.84 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
#-------------------------------------------------------------------------------
# pss: setup.py
#
# Setup/installation script.
#
# Eli Bendersky ([email protected])
# This code is in the public domain
#-------------------------------------------------------------------------------
import os, sys
try:
from setuptools import setup
use_setuptools = True
except ImportError:
from distutils.core import setup
use_setuptools = False
if use_setuptools:
# Setuptools provides an "entry points" facility to automatically generate
# scripts that work in the same way as the supplied "pss" script. This
# feature is more portable to other platforms than providing a manually
# created script, so we use that feature if it is available.
# By using entry points, we get a "pss" shell script on Unix, and a
# "pss.exe" command on Windows, without any extra effort.
extra_args = {
'entry_points': {
'console_scripts': 'pss = psslib.pss:main'
},
}
else:
# Setuptools is not available, so fall back to custom built scripts.
extra_args = {
'scripts': ['scripts/pss.py', 'scripts/pss'],
}
try:
with open('README.rst', 'rt') as readme:
description = '\n' + readme.read()
except IOError:
# maybe running setup.py from some other dir
description = ''
setup(
# metadata
name='pss',
description='Tool for grepping through source code',
long_description=description,
license='Public domain',
version='1.45',
author='Eli Bendersky',
maintainer='Eli Bendersky',
author_email='[email protected]',
url='https://github.com/eliben/pss',
platforms='Cross Platform',
classifiers = [
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',],
packages=['psslib', 'psslib.colorama'],
**extra_args
)