Skip to content

Loading…

Add post_install script to create start menu entries in Python 3 #1143

Closed
wants to merge 1 commit into from

2 participants

@takluyver
IPython member

This should fix #1119, but I can't test it, because I don't have a Windows machine handy, and Python in Wine seems to be having problems.

Can someone with a Windows machine test it? You'll need Python 3.2 installed. With this branch checked out, run C:\python32\python.exe setup.py bdist_wininst. This will produce a .exe installer - run that, and see if it completes without errors and creates start menu entries for IPython on Python 3.

@minrk
IPython member

Thanks, this I understand and am super comfortable with, so I'll do a test in a VM, and merge if it works.

@minrk
IPython member

Various few small fixes (print_statement, '3' suffix on files) are required to the script itself, but I've made them locally and this works just fine. I'll merge in a sec.

@minrk minrk added a commit that referenced this pull request
@minrk minrk Merge PR #1143 (Python3 StartMenu items)
Start Menu items are now installed with bdist_wininst on Python 3.

closes #1143
5047149
@minrk minrk added a commit that closed this pull request
@minrk minrk Merge PR #1143 (Python3 StartMenu items)
Start Menu items are now installed with bdist_wininst on Python 3.

closes #1143
5047149
@minrk minrk closed this in 5047149
@takluyver
IPython member

Thanks, Min.

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request
@minrk minrk Merge PR #1143 (Python3 StartMenu items)
Start Menu items are now installed with bdist_wininst on Python 3.

closes #1143
3714072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 15 additions and 0 deletions.
  1. +15 −0 setup3.py
View
15 setup3.py
@@ -1,4 +1,5 @@
import os.path
+import sys
from setuptools import setup
from setuptools.command.build_py import build_py
@@ -14,6 +15,20 @@
setup_args['package_data'] = find_package_data()
setup_args['cmdclass'] = {'build_py': record_commit_info('IPython', build_cmd=build_py)}
+# Script to be run by the windows binary installer after the default setup
+# routine, to add shortcuts and similar windows-only things. Windows
+# post-install scripts MUST reside in the scripts/ dir, otherwise distutils
+# doesn't find them.
+if 'bdist_wininst' in sys.argv:
+ if len(sys.argv) > 2 and \
+ ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
+ print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
+ sys.exit(1)
+ setup_args['scripts'] = [os.path.join('scripts','ipython_win_post_install.py')]
+ setup_args['options'] = {"bdist_wininst":
+ {"install_script":
+ "ipython_win_post_install.py"}}
+
def main():
setup(use_2to3 = True, **setup_args)
Something went wrong with that request. Please try again.