1#-------------------------------------------------------------------------------
2# pss: setup.py
3#
4# Setup/installation script.
5#
6# Eli Bendersky (eliben@gmail.com)
7# This code is in the public domain
8#-------------------------------------------------------------------------------
9import os, sys
10try:
11    from setuptools import setup
12    use_setuptools = True
13except ImportError:
14    from distutils.core import setup
15    use_setuptools = False
16
17if use_setuptools:
18    # Setuptools provides an "entry points" facility to automatically generate
19    # scripts that work in the same way as the supplied "pss" script. This
20    # feature is more portable to other platforms than providing a manually
21    # created script, so we use that feature if it is available.
22    # By using entry points, we get a "pss" shell script on Unix, and a
23    # "pss.exe" command on Windows, without any extra effort.
24    extra_args = {
25        'entry_points': {
26            'console_scripts': 'pss = psslib.pss:main'
27        },
28    }
29else:
30    # Setuptools is not available, so fall back to custom built scripts.
31    extra_args = {
32        'scripts': ['scripts/pss.py', 'scripts/pss'],
33    }
34
35
36try:
37    with open('README.rst', 'rt') as readme:
38        description = '\n' + readme.read()
39except IOError:
40    # maybe running setup.py from some other dir
41    description = ''
42
43
44setup(
45    # metadata
46    name='pss',
47    description='Tool for grepping through source code',
48    long_description=description,
49    license='Public domain',
50    version='1.43',
51    author='Eli Bendersky',
52    maintainer='Eli Bendersky',
53    author_email='eliben@gmail.com',
54    url='https://github.com/eliben/pss',
55    platforms='Cross Platform',
56    classifiers = [
57        'Programming Language :: Python :: 2',
58        'Programming Language :: Python :: 3',],
59
60    packages=['psslib', 'psslib.colorama'],
61
62    **extra_args
63)
64