mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-12 14:00:27 +08:00
Install on Windows without using setuptools
This creates batch files, with a .cmd extension, which can launch IPython from 'ipython' at a command line, to replace the .exe files created by setuptools. This makes repeated installations much quicker on Windows.
This commit is contained in:
parent
28cc4e9c84
commit
37a2a8a6e5
6
setup.py
6
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
|
||||
|
10
setupbase.py
10
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user