MCPcopy Index your code
hub / github.com/python/cpython / buildInstaller

Function buildInstaller

Mac/BuildScript/build-installer.py:1548–1588  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1546
1547
1548def buildInstaller():
1549
1550 # Zap all compiled files
1551 for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')):
1552 for fn in filenames:
1553 if fn.endswith('.pyc') or fn.endswith('.pyo'):
1554 os.unlink(os.path.join(dirpath, fn))
1555
1556 outdir = os.path.join(WORKDIR, 'installer')
1557 if os.path.exists(outdir):
1558 shutil.rmtree(outdir)
1559 os.mkdir(outdir)
1560
1561 pkgroot = os.path.join(outdir, 'Python.mpkg', 'Contents')
1562 pkgcontents = os.path.join(pkgroot, 'Packages')
1563 os.makedirs(pkgcontents)
1564 for recipe in pkg_recipes():
1565 packageFromRecipe(pkgcontents, recipe)
1566
1567 rsrcDir = os.path.join(pkgroot, 'Resources')
1568
1569 fn = os.path.join(pkgroot, 'PkgInfo')
1570 fp = open(fn, 'w')
1571 fp.write('pmkrpkg1')
1572 fp.close()
1573
1574 os.mkdir(rsrcDir)
1575
1576 makeMpkgPlist(os.path.join(pkgroot, 'Info.plist'))
1577 pl = dict(
1578 IFPkgDescriptionTitle="Python",
1579 IFPkgDescriptionVersion=getVersion(),
1580 )
1581
1582 writePlist(pl, os.path.join(pkgroot, 'Resources', 'Description.plist'))
1583 for fn in os.listdir('resources'):
1584 if fn == '.svn': continue
1585 if fn.endswith('.jpg'):
1586 shutil.copy(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
1587 else:
1588 patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
1589
1590
1591def installSize(clear=False, _saved=[]):

Callers 1

mainFunction · 0.85

Calls 15

pkg_recipesFunction · 0.85
packageFromRecipeFunction · 0.85
makeMpkgPlistFunction · 0.85
getVersionFunction · 0.85
writePlistFunction · 0.85
patchFileFunction · 0.85
listdirMethod · 0.80
openFunction · 0.50
walkMethod · 0.45
joinMethod · 0.45
endswithMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…