Skip to content

Commit a494434

Browse files
committed
handle setuptools magic (closes #26)
1 parent 25e129f commit a494434

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

setup.py

+18-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,22 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with this library. If not, see <http://www.gnu.org/licenses/>.
1818

19-
from distutils.command.install import install
20-
from distutils.command.install_lib import install_lib
21-
from distutils.core import setup
22-
from distutils.sysconfig import get_config_vars
19+
args = {}
20+
try:
21+
from setuptools import setup
22+
23+
from setuptools.command.install import install
24+
from setuptools.command.install_lib import install_lib
25+
26+
args['install_requires']=['pycrypto>=2.1']
27+
except ImportError:
28+
print '\n*** setuptools not found! Falling back to distutils\n\n'
29+
from distutils.core import setup
30+
31+
from distutils.command.install import install
32+
from distutils.command.install_lib import install_lib
33+
34+
2335
import os.path
2436

2537
class gajimpath_install(install):
@@ -153,4 +165,6 @@ def install(self):
153165
],
154166

155167
cmdclass={'install_lib':checked_install_lib, 'install':gajimpath_install},
168+
169+
**args
156170
)

0 commit comments

Comments
 (0)