mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
Add a setup.py to the tarball to bootstrap automated builds made by pip or easy_install.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
6
build.py
6
build.py
@@ -1383,6 +1383,12 @@ def cmd_sdist(options, args):
|
|||||||
destdir = posixjoin(PDEST, 'wx')
|
destdir = posixjoin(PDEST, 'wx')
|
||||||
for name in glob.glob(posixjoin('wx', wc)):
|
for name in glob.glob(posixjoin('wx', wc)):
|
||||||
copyFile(name, destdir)
|
copyFile(name, destdir)
|
||||||
|
|
||||||
|
# Also add the waf executable
|
||||||
|
copyFile('bin/waf-%s' % wafCurrentVersion, os.path.join(PDEST, 'bin'))
|
||||||
|
|
||||||
|
# Add a setup.py for the root folder
|
||||||
|
copyFile('packaging/setup.py', ADEST)
|
||||||
|
|
||||||
# build the tarball
|
# build the tarball
|
||||||
msg('Archiving Phoenix source...')
|
msg('Archiving Phoenix source...')
|
||||||
|
|||||||
33
packaging/setup.py
Normal file
33
packaging/setup.py
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# This setup file is placed in the root folder of the source dist tarball,
|
||||||
|
# and will be used to help do automated builds from tools like easy_install
|
||||||
|
# or pip. These tools expect to find at least the setup.py in the root
|
||||||
|
# folder, so let's accomodate them...
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import sys, os, glob
|
||||||
|
|
||||||
|
# Restructure the content of the tarball so things like pip or easy_install
|
||||||
|
# know how to build stuff. To be compatible with those tools the main source
|
||||||
|
# dir needs to be the root, so move all of Phoenix/* here.
|
||||||
|
SRC = 'Phoenix'
|
||||||
|
if os.path.exists(SRC) and os.path.isdir(SRC):
|
||||||
|
items = os.listdir(SRC)
|
||||||
|
for item in items:
|
||||||
|
os.rename(os.path.join(SRC, item), item)
|
||||||
|
os.rmdir(SRC)
|
||||||
|
|
||||||
|
# Somewhere along the way (probably when pip untars the source tar file) any
|
||||||
|
# executable permissions set on files in the tarball gets lost. Some of them
|
||||||
|
# will break our build if they are not executable, so turn them back on.
|
||||||
|
for wc in ['wxWidgets/configure',
|
||||||
|
'wxWidgets/src/stc/gen_iface.py',
|
||||||
|
'bin/waf-*', ]:
|
||||||
|
for item in glob.glob(wc):
|
||||||
|
os.chmod(item, 0755)
|
||||||
|
|
||||||
|
|
||||||
|
# Now execute the real setup.py that was copied here in order to do whatever
|
||||||
|
# command was trying to be done before.
|
||||||
|
execfile('setup.py')
|
||||||
|
|
||||||
1
setup.py
1
setup.py
@@ -254,6 +254,7 @@ if __name__ == '__main__':
|
|||||||
classifiers = [c for c in CLASSIFIERS.split("\n") if c],
|
classifiers = [c for c in CLASSIFIERS.split("\n") if c],
|
||||||
keywords = KEYWORDS,
|
keywords = KEYWORDS,
|
||||||
zip_safe = False,
|
zip_safe = False,
|
||||||
|
use_2to3 = False,
|
||||||
include_package_data = True,
|
include_package_data = True,
|
||||||
|
|
||||||
packages = WX_PKGLIST,
|
packages = WX_PKGLIST,
|
||||||
|
|||||||
Reference in New Issue
Block a user