diff --git a/tools/build_release b/tools/build_release index e7368f1..3f2cfe6 100755 --- a/tools/build_release +++ b/tools/build_release @@ -6,17 +6,6 @@ import os from toollib import * -# The windows builds are fairly painful to set up on a posix system via wine, -# so by default we've disabled them and we just build the windows installers -# separately in a true Windows VM. -do_windows = False - -# Egg building is also disabled by default. They serve no real purpose in -# python2, and getting a setupegg.py file that has valid python2/3 syntax is a -# pain in the ass. Since the python devs were too stubborn to leave execfile() -# in place in python3, then we just don't build eggs. -do_eggs = False - # Get main ipython dir, this will raise if it doesn't pass some checks ipdir = get_ipdir() cd(ipdir) @@ -35,15 +24,4 @@ for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'), # Build source and binary distros sh(sdists) - -# Build eggs -if do_eggs: - sh(eggs) - -if do_windows: - map(sh, win_builds) - # Change name so retarded Vista runs the installer correctly - sh("rename 's/linux-i686/win32/' dist/*.exe") - sh("rename 's/linux-x86_64/win32/' dist/*.exe") - # exe files aren't really executable under *nix. - sh("chmod -x dist/*.exe") +sh(wheels) diff --git a/tools/github_stats.py b/tools/github_stats.py index 0e7eb95..75604d9 100755 --- a/tools/github_stats.py +++ b/tools/github_stats.py @@ -101,11 +101,11 @@ def report(issues, show_urls=False): if show_urls: for i in issues: role = 'ghpull' if 'merged_at' in i else 'ghissue' - print('* :%s:`%d`: %s' % (role, i['number'], - i['title'].replace('`', '``').encode('utf-8'))) + print(u'* :%s:`%d`: %s' % (role, i['number'], + i['title'].replace(u'`', u'``'))) else: for i in issues: - print('* %d: %s' % (i['number'], i['title'].replace('`', '``').encode('utf-8'))) + print(u'* %d: %s' % (i['number'], i['title'].replace(u'`', u'``'))) #----------------------------------------------------------------------------- # Main script diff --git a/tools/release b/tools/release index 4bd50fd..6b25012 100755 --- a/tools/release +++ b/tools/release @@ -15,6 +15,8 @@ distdir = pjoin(ipdir, 'dist') # Where I keep static backups of each release ipbackupdir = os.path.expanduser('~/ipython/backup') +if not os.path.exists(ipbackupdir): + os.makedirs(ipbackupdir) # Start in main IPython dir cd(ipdir) @@ -53,14 +55,14 @@ sh('./setup.py register') # Upload all files sh(sdists + ' upload') -for py in ('2.7', '3.3'): +for py in ('2.7', '3.4'): sh('python%s setupegg.py bdist_wheel' % py) cd(distdir) print( 'Uploading distribution files...') for fname in os.listdir('.'): - # GitHub doesn't have an API for uploads at the moment + # TODO: update to GitHub releases API continue print('uploading %s to GitHub' % fname) desc = "IPython %s source distribution" % version diff --git a/tools/release_windows.py b/tools/release_windows.py deleted file mode 100644 index f7da08a..0000000 --- a/tools/release_windows.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -build [and upload] Windows IPython releases - -usage: - -python tools/release_windows.py [--github] [--pypi] - -Meant to be run on Windows - -Requires that you have python and python3 on your PATH -""" - -import glob -import os -import shutil -import sys - -from toollib import sh -try: - import gh_api -except ImportError: - gh_api = None - -github = '--github' in sys.argv - -cmd_t = "{py} setup.py bdist_wininst" - -pypi = '--pypi' in sys.argv -pypi_cmd_t = "python setup.py upload_wininst -f {fname}" - -# Windows Python cannot normally cross-compile, -# so you must have 4 Pythons to make 4 installers: -# http://docs.python.org/2/distutils/builtdist.html#cross-compiling-on-windows - -pythons = { - 2: { - 'win32' : r'C:\\Python27\Python.exe', - 'win-amd64': r'C:\\Python27_64\Python.exe', - }, - 3: { - 'win32' : r'C:\\Python33\Python.exe', - 'win-amd64': r'C:\\Python33_64\Python.exe', - }, -} - -for v,plat_py in pythons.items(): - # deliberately mangle the name, - # so easy_install doesn't find these and do horrible wrong things - try: - shutil.rmtree('build') - except OSError: - pass - for plat,py in plat_py.items(): - cmd = cmd_t.format(**locals()) - sh(cmd) - orig = glob.glob(os.path.join('dist', 'ipython-*.{plat}.exe'.format(**locals())))[0] - mangled = orig.replace('.{plat}.exe'.format(**locals()), - '.py{v}-{plat}.exe'.format(**locals()) - ) - os.rename(orig, mangled) - if pypi: - sh(pypi_cmd_t.format(fname=mangled)) - if github and gh_api: - print ("Uploading %s to GitHub" % mangled) - desc = "IPython Installer for Python {v}.x on {plat}".format(**locals()) - gh_api.post_download('ipython/ipython', mangled, description=desc) diff --git a/tools/toollib.py b/tools/toollib.py index 65f9eb4..6804674 100644 --- a/tools/toollib.py +++ b/tools/toollib.py @@ -20,24 +20,8 @@ archive = '%s:%s' % (archive_user, archive_dir) # Build commands # Source dists sdists = './setup.py sdist --formats=gztar,zip' -# Eggs -eggs = './setupegg.py bdist_egg' - -# Windows builds. -# We do them separately, so that the extra Windows scripts don't get pulled -# into Unix builds (setup.py has code which checks for bdist_wininst). Note -# that the install scripts args are added to the main distutils call in -# setup.py, so they don't need to be passed here. -# -# The Windows 64-bit installer can't be built by a Linux/Mac Python because ofa -# bug in distutils: http://bugs.python.org/issue6792. -# So we have to build it with a wine-installed native Windows Python... -win_builds = ["python setup.py bdist_wininst " - "--install-script=ipython_win_post_install.py", - r"%s/.wine/dosdevices/c\:/Python32/python.exe setup.py build " - "--plat-name=win-amd64 bdist_wininst " - "--install-script=ipython_win_post_install.py" % - os.environ['HOME'] ] +# Binary dists +wheels = './setupegg.py bdist_wheel' # Utility functions def sh(cmd):