##// END OF EJS Templates
Cleanup: Remove distutils...
farisachugthai -
Show More
@@ -12,18 +12,18 b' This includes:'
12 12 # Copyright (c) IPython Development Team.
13 13 # Distributed under the terms of the Modified BSD License.
14 14
15
16 import re
17 15 import os
16 import re
18 17 import sys
18 from glob import glob
19 from logging import log
19 20
20 from distutils import log
21 from distutils.command.build_py import build_py
21 from setuptools import Command
22 from setuptools.command.build_py import build_py
23 # TODO: Replacement for this?
22 24 from distutils.command.build_scripts import build_scripts
23 from distutils.command.install import install
24 from distutils.command.install_scripts import install_scripts
25 from distutils.cmd import Command
26 from glob import glob
25 from setuptools.command.install import install
26 from setuptools.command.install_scripts import install_scripts
27 27
28 28 from setupext import install_data_ext
29 29
@@ -115,14 +115,14 b' def find_package_data():'
115 115 """
116 116 # This is not enough for these things to appear in an sdist.
117 117 # We need to muck with the MANIFEST to get this to work
118
118
119 119 package_data = {
120 120 'IPython.core' : ['profile/README*'],
121 121 'IPython.core.tests' : ['*.png', '*.jpg', 'daft_extension/*.py'],
122 122 'IPython.lib.tests' : ['*.wav'],
123 123 'IPython.testing.plugin' : ['*.txt'],
124 124 }
125
125
126 126 return package_data
127 127
128 128
@@ -229,7 +229,7 b' def find_entry_points():'
229 229 command line scripts.
230 230
231 231 Each of our entry points gets both a plain name, e.g. ipython, and one
232 suffixed with the Python major version number, e.g. ipython3.
232 suffixed with the Python major version number, e.g. ipython3.
233 233 """
234 234 ep = [
235 235 'ipython%s = IPython:start_ipython',
@@ -247,10 +247,10 b" if __name__ == '__main__':"
247 247
248 248 class build_scripts_entrypt(build_scripts):
249 249 """Build the command line scripts
250
250
251 251 Parse setuptools style entry points and write simple scripts to run the
252 252 target functions.
253
253
254 254 On Windows, this also creates .cmd wrappers for the scripts so that you can
255 255 easily launch them from a command line.
256 256 """
@@ -269,7 +269,7 b' class build_scripts_entrypt(build_scripts):'
269 269 with open(outfile, 'w') as f:
270 270 f.write(script_src.format(executable=sys.executable,
271 271 mod=mod, func=func))
272
272
273 273 if sys.platform == 'win32':
274 274 # Write .cmd wrappers for Windows so 'ipython' etc. work at the
275 275 # command line
@@ -323,7 +323,7 b' class install_symlinked(install):'
323 323 # Run all sub-commands (at least those that need to be run)
324 324 for cmd_name in self.get_sub_commands():
325 325 self.run_command(cmd_name)
326
326
327 327 # 'sub_commands': a list of commands this command might have to run to
328 328 # get its work done. See cmd.py for more info.
329 329 sub_commands = [('install_lib_symlink', lambda self:True),
@@ -332,7 +332,7 b' class install_symlinked(install):'
332 332
333 333 class install_scripts_for_symlink(install_scripts):
334 334 """Redefined to get options from 'symlink' instead of 'install'.
335
335
336 336 I love distutils almost as much as I love setuptools.
337 337 """
338 338 def finalize_options(self):
@@ -356,7 +356,7 b' def git_prebuild(pkg_dir, build_cmd=build_py):'
356 356
357 357 for use in IPython.utils.sysinfo.sys_info() calls after installation.
358 358 """
359
359
360 360 class MyBuildPy(build_cmd):
361 361 ''' Subclass to write commit data into installation tree '''
362 362 def run(self):
@@ -371,12 +371,12 b' def git_prebuild(pkg_dir, build_cmd=build_py):'
371 371 # this one will only fire for build commands
372 372 if hasattr(self, 'build_lib'):
373 373 self._record_commit(self.build_lib)
374
374
375 375 def make_release_tree(self, base_dir, files):
376 376 # this one will fire for sdist
377 377 build_cmd.make_release_tree(self, base_dir, files)
378 378 self._record_commit(base_dir)
379
379
380 380 def _record_commit(self, base_dir):
381 381 import subprocess
382 382 proc = subprocess.Popen('git rev-parse --short HEAD',
@@ -385,14 +385,14 b' def git_prebuild(pkg_dir, build_cmd=build_py):'
385 385 shell=True)
386 386 repo_commit, _ = proc.communicate()
387 387 repo_commit = repo_commit.strip().decode("ascii")
388
388
389 389 out_pth = pjoin(base_dir, pkg_dir, 'utils', '_sysinfo.py')
390 390 if os.path.isfile(out_pth) and not repo_commit:
391 391 # nothing to write, don't clobber
392 392 return
393
393
394 394 print("writing git commit '%s' to %s" % (repo_commit, out_pth))
395
395
396 396 # remove to avoid overwriting original via hard link
397 397 try:
398 398 os.remove(out_pth)
General Comments 0
You need to be logged in to leave comments. Login now