'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)
#!/usr/bin/env python """Simple script to create a tarball with proper git info. """ import subprocess import os from toollib import cd, sh tag = ( subprocess.check_output("git describe --tags", shell=True) .decode("utf8", "replace") .strip() ) base_name = "ipython-%s" % tag tar_name = "%s.tgz" % base_name # git archive is weird: Even if I give it a specific path, it still won't # archive the whole tree. It seems the only way to get the whole tree is to cd # to the top of the tree. There are long threads (since 2007) on the git list # about this and it still doesn't work in a sensible way... cd("..") git_tpl = "git archive --format=tar --prefix={0}/ HEAD | gzip > {1}" sh(git_tpl.format(base_name, tar_name)) sh("mv {0} tools/".format(tar_name))
'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)
#!/usr/bin/env python """Simple script to create a tarball with proper git info. """ import subprocess import os from toollib import cd, sh tag = subprocess.getoutput('git describe --tags') base_name = 'ipython-%s' % tag tar_name = '%s.tgz' % base_name # git archive is weird: Even if I give it a specific path, it still won't # archive the whole tree. It seems the only way to get the whole tree is to cd # to the top of the tree. There are long threads (since 2007) on the git list # about this and it still doesn't work in a sensible way... cd('..') git_tpl = 'git archive --format=tar --prefix={0}/ HEAD | gzip > {1}' sh(git_tpl.format(base_name, tar_name)) sh('mv {0} tools/'.format(tar_name))