mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 13:00:07 +01:00
Merge branch 'misc-fixes'
This commit is contained in:
14
README.rst
14
README.rst
@@ -41,18 +41,28 @@ or building an egg.
|
||||
Using the build.py script allows for greater control over the build process
|
||||
than setup.py does, including commands for performing the various
|
||||
code-generation steps. So developers working on Phoenix itself or building
|
||||
from a Git checkout, instead of just building it from a source snapshot,
|
||||
should be using the build.py script. Build.py provides a fairly simple
|
||||
from a Git checkout, instead of a source snapshot tarball, should be using
|
||||
the build.py script. The build.py script provides a fairly simple
|
||||
command-line interface consisting of commands and options. To see the full
|
||||
list run ``python build.py --help``. The most important commands are listed
|
||||
below.
|
||||
|
||||
**Windows Users NOTE:** If you are building Phoenix on Windows and have a
|
||||
non-English language installation of Microsoft Visual Studio then you may
|
||||
need to set the code page in your console window in order to avoid Unicode
|
||||
decoding errors. For example::
|
||||
|
||||
chcp 1252
|
||||
python build.py <build commands>...
|
||||
|
||||
|
||||
If you just want to do a standard setuptools-style build using setup.py and
|
||||
are using a full source tarball, then you can stop reading at this point. If
|
||||
you want to build from a source repository checkout, or need to make changes
|
||||
and/or to regenerate some of the generated source files, then please continue
|
||||
reading.
|
||||
|
||||
|
||||
Building wxWidgets
|
||||
------------------
|
||||
|
||||
|
||||
74
build.py
74
build.py
@@ -147,9 +147,6 @@ def main(args):
|
||||
os.environ['PYTHONPATH'] = phoenixDir()
|
||||
os.environ['PYTHONUNBUFFERED'] = 'yes'
|
||||
os.environ['WXWIN'] = wxDir()
|
||||
cfg = Config(noWxConfig=True)
|
||||
msg('cfg.VERSION: %s' % cfg.VERSION)
|
||||
msg('')
|
||||
|
||||
wxpydir = os.path.join(phoenixDir(), "wx")
|
||||
if not os.path.exists(wxpydir):
|
||||
@@ -161,6 +158,10 @@ def main(args):
|
||||
|
||||
options, commands = parseArgs(args)
|
||||
|
||||
cfg = Config(noWxConfig=True)
|
||||
msg('cfg.VERSION: %s' % cfg.VERSION)
|
||||
msg('')
|
||||
|
||||
while commands:
|
||||
# ensure that each command starts with the CWD being the phoenix dir.
|
||||
os.chdir(phoenixDir())
|
||||
@@ -408,6 +409,7 @@ def makeOptionParser():
|
||||
("x64", (False, "Use and build for the 64bit version of Python on Windows")),
|
||||
("jom", (False, "Use jom instead of nmake for the wxMSW build")),
|
||||
("relwithdebug", (False, "Turn on the generation of debug info for release builds on MSW.")),
|
||||
("release_build", (False, "Turn off some development options for a release build.")),
|
||||
]
|
||||
|
||||
parser = optparse.OptionParser("build options:")
|
||||
@@ -418,19 +420,29 @@ def makeOptionParser():
|
||||
action = 'store_true'
|
||||
parser.add_option('--'+opt, default=default, action=action,
|
||||
dest=opt, help=txt)
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
def parseArgs(args):
|
||||
parser = makeOptionParser()
|
||||
options, args = parser.parse_args(args)
|
||||
|
||||
if isWindows:
|
||||
# We always use magic on Windows
|
||||
options.no_magic = False
|
||||
options.use_syswx = False
|
||||
elif options.use_syswx:
|
||||
# Turn off magic if using the system wx
|
||||
options.no_magic = True
|
||||
|
||||
# Some options don't make sense for release builds
|
||||
if options.release_build:
|
||||
options.debug = False
|
||||
options.both = False
|
||||
options.relwithdebug = False
|
||||
if os.path.exists('REV.txt'):
|
||||
os.unlink('REV.txt')
|
||||
|
||||
return options, args
|
||||
|
||||
|
||||
@@ -603,7 +615,7 @@ class CommandTimer(object):
|
||||
msg('Finished command: %s (%s)' % (self.name, time))
|
||||
|
||||
|
||||
def uploadPackage(fileName, mask=defaultMask, keep=50):
|
||||
def uploadPackage(fileName, options, mask=defaultMask, keep=50):
|
||||
"""
|
||||
Upload the given filename to the configured package server location. Only
|
||||
the `keep` most recent files matching `mask` will be kept so the server
|
||||
@@ -618,29 +630,32 @@ def uploadPackage(fileName, mask=defaultMask, keep=50):
|
||||
# idenity file, etc needed for making an SSH connection to the
|
||||
# snapshots server.
|
||||
host = 'wxpython-rbot'
|
||||
snapshotDir = 'snapshot-builds'
|
||||
if options.release_build:
|
||||
uploadDir = 'release-builds'
|
||||
else:
|
||||
uploadDir = 'snapshot-builds'
|
||||
|
||||
# copy the new file to the server
|
||||
cmd = 'scp {} {}:{}'.format(fileName, host, snapshotDir)
|
||||
msg(cmd)
|
||||
cmd = 'scp {} {}:{}'.format(fileName, host, uploadDir)
|
||||
#msg(cmd)
|
||||
runcmd(cmd)
|
||||
|
||||
# Make sure it is readable by all
|
||||
cmd = 'ssh {} "cd {}; chmod a+r {}"'.format(host, snapshotDir, os.path.basename(fileName))
|
||||
cmd = 'ssh {} "cd {}; chmod a+r {}"'.format(host, uploadDir, os.path.basename(fileName))
|
||||
runcmd(cmd)
|
||||
|
||||
# get the list of all snapshot files on the server
|
||||
cmd = 'ssh {} "cd {}; ls {}"'.format(host, snapshotDir, mask)
|
||||
cmd = 'ssh {} "cd {}; ls {}"'.format(host, uploadDir, mask)
|
||||
allFiles = runcmd(cmd, getOutput=True)
|
||||
allFiles = allFiles.strip().split('\n')
|
||||
allFiles.sort()
|
||||
|
||||
# Leave the last keep builds, including this new one, on the server.
|
||||
# Leave the last keep number of builds, including this new one, on the server.
|
||||
# Delete the rest.
|
||||
rmFiles = allFiles[:-keep]
|
||||
if rmFiles:
|
||||
msg("Deleting %s" % ", ".join(rmFiles))
|
||||
cmd = 'ssh {} "cd {}; rm {}"'.format(host, snapshotDir, " ".join(rmFiles))
|
||||
cmd = 'ssh {} "cd {}; rm {}"'.format(host, uploadDir, " ".join(rmFiles))
|
||||
runcmd(cmd)
|
||||
|
||||
msg("Upload complete!")
|
||||
@@ -936,7 +951,7 @@ def cmd_docs_bdist(options, args):
|
||||
tarball.close()
|
||||
|
||||
if options.upload:
|
||||
uploadPackage(tarfilename, keep=5,
|
||||
uploadPackage(tarfilename, options, keep=5,
|
||||
mask='%s-docs-%s*' % (baseName, cfg.VER_MAJOR))
|
||||
|
||||
msg('Documentation tarball built at %s' % tarfilename)
|
||||
@@ -1359,7 +1374,7 @@ def cmd_bdist_egg(options, args):
|
||||
filemask = "dist/%s-%s-*.egg" % (baseName, cfg.VERSION.replace('-', '_'))
|
||||
filenames = glob.glob(filemask)
|
||||
assert len(filenames) == 1
|
||||
uploadPackage(filenames[0])
|
||||
uploadPackage(filenames[0], options)
|
||||
|
||||
|
||||
def cmd_bdist_wheel(options, args):
|
||||
@@ -1369,7 +1384,7 @@ def cmd_bdist_wheel(options, args):
|
||||
filemask = "dist/%s-%s-*.whl" % (baseName, cfg.VERSION.replace('-', '_'))
|
||||
filenames = glob.glob(filemask)
|
||||
assert len(filenames) == 1
|
||||
uploadPackage(filenames[0])
|
||||
uploadPackage(filenames[0], options)
|
||||
|
||||
|
||||
def cmd_bdist_wininst(options, args):
|
||||
@@ -1379,7 +1394,7 @@ def cmd_bdist_wininst(options, args):
|
||||
filemask = "dist/%s-%s-*.exe" % (baseName, cfg.VERSION.replace('-', '_'))
|
||||
filenames = glob.glob(filemask)
|
||||
assert len(filenames) == 1
|
||||
uploadPackage(filenames[0])
|
||||
uploadPackage(filenames[0], options)
|
||||
|
||||
|
||||
# bdist_msi requires the version number to be only 3 components, but we're
|
||||
@@ -1528,8 +1543,6 @@ def cmd_sdist(options, args):
|
||||
WDEST = posixjoin(PDEST, 'ext/wxWidgets')
|
||||
if not os.path.exists(PDEST):
|
||||
os.makedirs(PDEST)
|
||||
#if not os.path.exists(WDEST):
|
||||
# os.makedirs(WDEST)
|
||||
|
||||
# and a place to put the final tarball
|
||||
if not os.path.exists('dist'):
|
||||
@@ -1561,8 +1574,6 @@ def cmd_sdist(options, args):
|
||||
copyFile('REV.txt', PDEST)
|
||||
|
||||
# Add some extra stuff to the root folder
|
||||
#copyFile('packaging/setup.py', ADEST)
|
||||
#copyFile('packaging/README-sdist.txt', opj(ADEST, 'README.txt'))
|
||||
cmd_egg_info(options, args, egg_base=PDEST)
|
||||
copyFile(opj(PDEST, 'wxPython_Phoenix.egg-info/PKG-INFO'),
|
||||
opj(PDEST, 'PKG-INFO'))
|
||||
@@ -1583,7 +1594,7 @@ def cmd_sdist(options, args):
|
||||
shutil.rmtree(PDEST)
|
||||
|
||||
if options.upload:
|
||||
uploadPackage(tarfilename)
|
||||
uploadPackage(tarfilename, options)
|
||||
|
||||
msg("Source release built at %s" % tarfilename)
|
||||
|
||||
@@ -1634,7 +1645,7 @@ def cmd_bdist(options, args):
|
||||
tarball.close()
|
||||
|
||||
if options.upload:
|
||||
uploadPackage(tarfilename)
|
||||
uploadPackage(tarfilename, options)
|
||||
|
||||
msg("Binary release built at %s" % tarfilename)
|
||||
|
||||
@@ -1647,14 +1658,21 @@ def cmd_setrev(options, args):
|
||||
cmdTimer = CommandTimer('setrev')
|
||||
assert os.getcwd() == phoenixDir()
|
||||
|
||||
svnrev = getVcsRev()
|
||||
f = open('REV.txt', 'w')
|
||||
svnrev = '.dev'+svnrev
|
||||
f.write(svnrev)
|
||||
f.close()
|
||||
if options.release_build:
|
||||
# Ignore this command for release builds, they are not supposed to
|
||||
# include current VCS revision info in the version number.
|
||||
msg('This is a release build, setting REV.txt skipped')
|
||||
|
||||
else:
|
||||
svnrev = getVcsRev()
|
||||
f = open('REV.txt', 'w')
|
||||
svnrev = '.dev'+svnrev
|
||||
f.write(svnrev)
|
||||
f.close()
|
||||
msg('REV.txt set to "%s"' % svnrev)
|
||||
|
||||
cfg = Config()
|
||||
cfg.resetVersion()
|
||||
msg('REV.txt set to "%s"' % svnrev)
|
||||
msg('cfg.VERSION: %s' % cfg.VERSION)
|
||||
|
||||
|
||||
|
||||
@@ -160,7 +160,8 @@ def getoutput(cmd):
|
||||
output = None
|
||||
output = sp.stdout.read()
|
||||
if sys.version_info > (3,):
|
||||
output = output.decode('utf-8') # TODO: is utf-8 okay here?
|
||||
outputEncoding = 'cp1252' if sys.platform == 'win32' else 'utf-8'
|
||||
output = output.decode(outputEncoding)
|
||||
output = output.rstrip()
|
||||
rval = sp.wait()
|
||||
if rval:
|
||||
|
||||
@@ -31,7 +31,7 @@ VER_FLAGS = "" # wxPython release flags
|
||||
# if it exists, and is appended to VER_FLAGS
|
||||
#
|
||||
# "a1" for official alpha releases
|
||||
# "b1" for beta relases
|
||||
# "b1" for beta releases
|
||||
# "rc1" for release candidate releases
|
||||
#
|
||||
# "-1a1" For alpha releases of a numbered post release, (betas, etc.
|
||||
|
||||
@@ -88,6 +88,9 @@
|
||||
<p class="biglink"><a class="biglink" href="{{ pathto("xrc.1classindex") }}">wx.xrc</a><br/>
|
||||
<span class="linkdescr">Classes for loading widgets and layout from XML</span></p>
|
||||
|
||||
<p class="biglink"><a class="biglink" href="{{ pathto("media.1classindex") }}">wx.media</a><br/>
|
||||
<span class="linkdescr">MediaCtrl and related classes</span></p>
|
||||
|
||||
<p class="biglink"><a class="biglink" href="{{ pathto("xml.1classindex") }}">wx.xml</a><br/>
|
||||
<span class="linkdescr">Some simple XML classes for use with XRC</span></p>
|
||||
|
||||
@@ -101,4 +104,4 @@
|
||||
</table>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -58,6 +58,7 @@ software wheels like what is available here, with a command like
|
||||
this:
|
||||
|
||||
pip install -U --pre \
|
||||
--trusted-host wxpython.org \
|
||||
-f http://wxpython.org/Phoenix/snapshot-builds/ \
|
||||
wxPython_Phoenix
|
||||
|
||||
@@ -71,6 +72,7 @@ To install a specific binary from this site you can append the version
|
||||
number to the command, like this:
|
||||
|
||||
pip install -U --pre \
|
||||
--trusted-host wxpython.org \
|
||||
-f http://wxpython.org/Phoenix/snapshot-builds/ \
|
||||
wxPython_Phoenix==3.0.3.dev1641+76cf834
|
||||
|
||||
|
||||
Reference in New Issue
Block a user