From 7af058aae8ab8fa25023130d329d1886e1b256e5 2018-09-11 09:43:20 From: Matthias Bussonnier Date: 2018-09-11 09:43:20 Subject: [PATCH] cleanup build process --- diff --git a/tools/build_release b/tools/build_release index 998010a..26dc9ec 100755 --- a/tools/build_release +++ b/tools/build_release @@ -4,7 +4,7 @@ import os from shutil import rmtree -from toollib import sh, pjoin, get_ipdir, cd, execfile, sdists, buildwheels +from toollib import sh, pjoin, get_ipdir, cd, sdists, buildwheels def build_release(): @@ -12,13 +12,6 @@ def build_release(): ipdir = get_ipdir() cd(ipdir) - # Load release info - execfile(pjoin('IPython', 'core', 'release.py'), globals()) - - with open('docs/source/whatsnew/index.rst') as f: - if ' development' in f.read(): - raise ValueError("Please remove `development` from what's new toctree for release") - # Cleanup for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'), pjoin('docs', 'source', 'api', 'generated')]: diff --git a/tools/toollib.py b/tools/toollib.py index fd160c5..510b54e 100644 --- a/tools/toollib.py +++ b/tools/toollib.py @@ -3,6 +3,7 @@ # Library imports import os +import sys # Useful shorthands pjoin = os.path.join @@ -20,7 +21,7 @@ archive = '%s:%s' % (archive_user, archive_dir) sdists = './setup.py sdist --formats=gztar' # Binary dists def buildwheels(): - sh('python3 setupegg.py bdist_wheel') + sh('{python} setupegg.py bdist_wheel'.format(python=sys.executable)) # Utility functions def sh(cmd): @@ -31,9 +32,6 @@ def sh(cmd): if stat: raise SystemExit("Command %s failed with code: %s" % (cmd, stat)) -# Backwards compatibility -c = sh - def get_ipdir(): """Get IPython directory from command line, or assume it's the one above.""" @@ -47,9 +45,6 @@ def get_ipdir(): raise SystemExit('Invalid ipython directory: %s' % ipdir) return ipdir -try: - execfile = execfile -except NameError: - def execfile(fname, globs, locs=None): - locs = locs or globs - exec(compile(open(fname).read(), fname, "exec"), globs, locs) +def execfile(fname, globs, locs=None): + locs = locs or globs + exec(compile(open(fname).read(), fname, "exec"), globs, locs)