##// END OF EJS Templates
Merge pull request #10446 from takluyver/setup-cleanup...
Matthias Bussonnier -
r23549:a386d4ee merge
parent child Browse files
Show More
@@ -17,24 +17,26 b' requires utilities which are not available under Windows."""'
17 17 # The full license is in the file COPYING.rst, distributed with this software.
18 18 #-----------------------------------------------------------------------------
19 19
20 #-----------------------------------------------------------------------------
21 # Minimal Python version sanity check
22 #-----------------------------------------------------------------------------
23 20 from __future__ import print_function
24 21
22 import os
25 23 import sys
26 24
25 # **Python version check**
26 #
27 27 # This check is also made in IPython/__init__, don't forget to update both when
28 28 # changing Python version requirements.
29 29 if sys.version_info < (3,3):
30 try:
31 30 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1. '
31 try:
32 32 import pip
33 33 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
34 print(pip_version)
35 34 if pip_version < (9, 0, 1) :
36 pip_message = 'You pip version is out of date, please install pip >= 9.0.1.'\
35 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
37 36 'pip {} detected.'.format(pip.__version__)
37 else:
38 # pip is new enough - it must be something else
39 pip_message = ''
38 40 except Exception:
39 41 pass
40 42
@@ -57,15 +59,6 b' Python {py} detected.'
57 59
58 60 # At least we're on the python version we need, move on.
59 61
60 #-------------------------------------------------------------------------------
61 # Imports
62 #-------------------------------------------------------------------------------
63
64 # Stdlib imports
65 import os
66
67 from glob import glob
68
69 62 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
70 63 # update it when the contents of directories change.
71 64 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
@@ -146,32 +139,11 b" setup_args['data_files'] = data_files"
146 139 #---------------------------------------------------------------------------
147 140 # imports here, so they are after setuptools import if there was one
148 141 from distutils.command.sdist import sdist
149 from distutils.command.upload import upload
150
151 class UploadWindowsInstallers(upload):
152
153 description = "Upload Windows installers to PyPI (only used from tools/release_windows.py)"
154 user_options = upload.user_options + [
155 ('files=', 'f', 'exe file (or glob) to upload')
156 ]
157 def initialize_options(self):
158 upload.initialize_options(self)
159 meta = self.distribution.metadata
160 base = '{name}-{version}'.format(
161 name=meta.get_name(),
162 version=meta.get_version()
163 )
164 self.files = os.path.join('dist', '%s.*.exe' % base)
165
166 def run(self):
167 for dist_file in glob(self.files):
168 self.upload_file('bdist_wininst', 'any', dist_file)
169 142
170 143 setup_args['cmdclass'] = {
171 144 'build_py': \
172 145 check_package_data_first(git_prebuild('IPython')),
173 146 'sdist' : git_prebuild('IPython', sdist),
174 'upload_wininst' : UploadWindowsInstallers,
175 147 'symlink': install_symlinked,
176 148 'install_lib_symlink': install_lib_symlink,
177 149 'install_scripts_sym': install_scripts_for_symlink,
@@ -185,10 +157,10 b" setup_args['cmdclass'] = {"
185 157
186 158 # For some commands, use setuptools. Note that we do NOT list install here!
187 159 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
188 needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
160 needs_setuptools = {'develop', 'release', 'bdist_egg', 'bdist_rpm',
189 161 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel',
190 162 'egg_info', 'easy_install', 'upload', 'install_egg_info',
191 ))
163 }
192 164
193 165 if len(needs_setuptools.intersection(sys.argv)) > 0:
194 166 import setuptools
@@ -270,23 +242,7 b" if 'setuptools' in sys.modules:"
270 242 ],
271 243 }
272 244 setup_args['extras_require'] = extras_require
273 requires = setup_args['install_requires'] = install_requires
274
275 # Script to be run by the windows binary installer after the default setup
276 # routine, to add shortcuts and similar windows-only things. Windows
277 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
278 # doesn't find them.
279 if 'bdist_wininst' in sys.argv:
280 if len(sys.argv) > 2 and \
281 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
282 print("ERROR: bdist_wininst must be run alone. Exiting.", file=sys.stderr)
283 sys.exit(1)
284 setup_args['data_files'].append(
285 ['Scripts', ('scripts/ipython.ico', 'scripts/ipython_nb.ico')])
286 setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
287 setup_args['options'] = {"bdist_wininst":
288 {"install_script":
289 "ipython_win_post_install.py"}}
245 setup_args['install_requires'] = install_requires
290 246
291 247 else:
292 248 # scripts has to be a non-empty list, or install_scripts isn't called
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now