Permalink
Browse files

Only mark argparse as required for versions of Python without argparse

Conditionally include argparse as a requirement only for versions of
Python that do not have argparse already bundled.
  • Loading branch information...
1 parent db23ba5 commit 8d87c035dfad64de9898da447daaee319e34b423 @kfdm kfdm committed Mar 18, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 setup.py
View
@@ -3,6 +3,13 @@
import glob
from setuptools import setup, find_packages
+install_requires = ['distribute']
+
+try:
+ import argparse
+except ImportError:
+ install_requires.append('argparse')
+
setup(
name='argcomplete',
version='0.3.9',
@@ -12,7 +19,7 @@
author_email='kislyuk@gmail.com',
description='Bash tab completion for argparse',
long_description=open('README.rst').read(),
- install_requires=['distribute', 'argparse'],
+ install_requires=install_requires,
packages = find_packages(),
scripts = glob.glob('scripts/*'),
package_data={'argcomplete': ['bash_completion.d/python-argcomplete.sh']},

0 comments on commit 8d87c03

Please sign in to comment.