Commits

Ian Bicking committed d776b6a

allow script creation without setuptools

Comments (0)

Files changed (2)

scripts/virtualenv

+#!/usr/bin/env python
+import virtualenv
+virtualenv.main()
+import sys, os
 try:
     from setuptools import setup
+    kw = {'entry_points':
+          """[console_scripts]\nvirtualenv = virtualenv:main\n""",
+          'zip_safe': False}
 except ImportError:
     from distutils.core import setup
-    print 'Note: without Setuptools installed you will have to use "python -m virtualenv ENV"'
-import sys, os
+    if sys.platform == 'win32':
+        print 'Note: without Setuptools installed you will have to use "python -m virtualenv ENV"'
+    else:
+        kw = {'scripts': ['scripts/virtualenv']}
 import re
-## A warning just for Ian:
-try:
-    import getpass
-except ImportError:
-    is_ianb = False
-else:
-    is_ianb = getpass.getuser() == 'ianb'
 
 here = os.path.dirname(os.path.abspath(__file__))
 
 long_description = long_description.split('split here', 1)[1]
 f.close()
 
+## A warning just for Ian (related to distribution):
+try:
+    import getpass
+except ImportError:
+    is_ianb = False
+else:
+    is_ianb = getpass.getuser() == 'ianb'
+
 if is_ianb and 'register' in sys.argv:
     if 'hg tip\n~~~~~~' in long_description:
         print >> sys.stderr, (
       py_modules=['virtualenv'],
       packages=['virtualenv_support'],
       package_data={'virtualenv_support': ['*-py%s.egg' % sys.version[:3], '*.tar.gz']},
-      zip_safe=False,
-      entry_points="""
-      [console_scripts]
-      virtualenv = virtualenv:main
-      """,
+      **kw
       )