Add an item to wx.PlatformInfo and wx.__version__ indicating build type:

Development, snapshot or release
This commit is contained in:
Robin Dunn
2017-09-27 17:24:47 -07:00
parent a5cfe9bbab
commit 541c4882da
5 changed files with 21 additions and 6 deletions

View File

@@ -1368,6 +1368,9 @@ def cmd_build_py(options, args):
BUILD_DIR = getBuildDir(options)
if options.release:
os.environ['WXPYTHON_RELEASE'] = 'yes'
if not isWindows:
WX_CONFIG = posixjoin(BUILD_DIR, 'wx-config')
if options.use_syswx:

View File

@@ -337,8 +337,16 @@ class Configuration(object):
# is a release build. (In theory)
if os.path.exists('REV.txt'):
f = open('REV.txt')
self.VER_FLAGS += f.read().strip()
txt = f.read().strip()
self.VER_FLAGS += txt
if txt[0] == '.':
txt = txt[1:]
self.BUILD_TYPE = txt
f.close()
elif os.environ.get('WXPYTHON_RELEASE') == 'yes':
self.BUILD_TYPE = "release"
else:
self.BUILD_TYPE = "devel"
self.VERSION = "%s.%s.%s%s" % (self.VER_MAJOR,
self.VER_MINOR,

View File

@@ -1,3 +1,3 @@
# This file was generated by Phoenix's wscript.
# This file was generated by wxPython's wscript.
VERSION_STRING = '4.0.0rc1'

View File

@@ -6,6 +6,9 @@ if 'wxEVT_NULL' in dir():
import wx._core
__version__ = VERSION_STRING
# Add the build type to PlatformInfo
PlatformInfo = PlatformInfo + ('build-type: ' + BUILD_TYPE, )
# Register a function to be called when Python terminates that will clean
# up and release all system resources that wxWidgets allocated.
import atexit

View File

@@ -34,7 +34,7 @@ def options(opt):
opt.load('python')
opt.add_option('--debug', dest='debug', action='store_true', default=False,
help='Turn on debug compile options.')
help='Turn on debugger-related compile options.')
opt.add_option('--python', dest='python', default='', action='store',
help='Full path to the Python executable to use.')
opt.add_option('--wx_config', dest='wx_config', default='wx-config', action='store',
@@ -482,16 +482,17 @@ def build(bld):
# create the package's __version__ module
open(opj(cfg.PKGDIR, '__version__.py'), 'w').write(
"# This file was generated by Phoenix's wscript.\n\n"
"# This file was generated by wxPython's wscript.\n\n"
"VERSION_STRING = '%(VERSION)s'\n"
"MAJOR_VERSION = %(VER_MAJOR)s\n"
"MINOR_VERSION = %(VER_MINOR)s\n"
"RELEASE_NUMBER = %(VER_RELEASE)s\n\n"
"RELEASE_NUMBER = %(VER_RELEASE)s\n"
"BUILD_TYPE = '%(BUILD_TYPE)s'\n\n"
"VERSION = (MAJOR_VERSION, MINOR_VERSION, RELEASE_NUMBER, '%(VER_FLAGS)s')\n"
% cfg.__dict__)
# and one for the demo folder too
open('demo/version.py', 'w').write(
"# This file was generated by Phoenix's wscript.\n\n"
"# This file was generated by wxPython's wscript.\n\n"
"VERSION_STRING = '%(VERSION)s'\n"
% cfg.__dict__)