diff --git a/setup.py b/setup.py index 931d216..0621306 100755 --- a/setup.py +++ b/setup.py @@ -252,12 +252,6 @@ needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm', 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel', 'egg_info', 'easy_install', 'upload', 'install_egg_info', )) -if sys.platform == 'win32': - # Depend on setuptools for install on *Windows only* - # If we get script-installation working without setuptools, - # then we can back off, but until then use it. - # See Issue #369 on GitHub for more - needs_setuptools.add('install') if len(needs_setuptools.intersection(sys.argv)) > 0: import setuptools diff --git a/setupbase.py b/setupbase.py index 749b594..da5d76a 100644 --- a/setupbase.py +++ b/setupbase.py @@ -403,6 +403,16 @@ class build_scripts_entrypt(build_scripts): with open(outfile, 'w') as f: f.write(script_src.format(executable=sys.executable, mod=mod, func=func)) + + if sys.platform == 'win32': + # Write .cmd wrappers for Windows so 'ipython' etc. work at the + # command line + cmd_file = os.path.join(self.build_dir, name + '.cmd') + cmd = '@"{python}" "%~dp0\{script}" %*\r\n'.format( + python=sys.executable, script=name) + log.info("Writing %s wrapper script" % cmd_file) + with open(cmd_file, 'w') as f: + f.write(cmd) return outfiles, outfiles