diff --git a/build.py b/build.py index cf48ac27..d013e068 100755 --- a/build.py +++ b/build.py @@ -135,6 +135,7 @@ def main(args): 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") @@ -1219,7 +1220,7 @@ def cmd_bdist_egg(options, args): _doSimpleSetupCmd(options, args, 'bdist_egg') cfg = Config() if options.upload: - filemask = "dist/%s-%s-*.egg" % (baseName, cfg.VERSION) + filemask = "dist/%s-%s-*.egg" % (baseName, cfg.VERSION.replace('-', '_')) filenames = glob.glob(filemask) assert len(filenames) == 1 uploadPackage(filenames[0]) @@ -1229,7 +1230,7 @@ def cmd_bdist_wheel(options, args): _doSimpleSetupCmd(options, args, 'bdist_wheel') cfg = Config() if options.upload: - filemask = "dist/%s-%s-*.whl" % (baseName, cfg.VERSION) + filemask = "dist/%s-%s-*.whl" % (baseName, cfg.VERSION.replace('-', '_')) filenames = glob.glob(filemask) assert len(filenames) == 1 uploadPackage(filenames[0]) @@ -1238,7 +1239,7 @@ def cmd_bdist_wininst(options, args): _doSimpleSetupCmd(options, args, 'bdist_wininst') cfg = Config() if options.upload: - filemask = "dist/%s-%s-*.exe" % (baseName, cfg.VERSION) + filemask = "dist/%s-%s-*.exe" % (baseName, cfg.VERSION.replace('-', '_')) filenames = glob.glob(filemask) assert len(filenames) == 1 uploadPackage(filenames[0]) @@ -1518,6 +1519,7 @@ def cmd_setrev(options, args): svnrev = getSvnRev() f = open('REV.txt', 'w') + svnrev = '.dev'+svnrev f.write(svnrev) f.close() cfg = Config() diff --git a/buildtools/config.py b/buildtools/config.py index 1fca384a..702ea996 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -335,14 +335,13 @@ 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() + self.VER_FLAGS += f.read().strip() f.close() - self.VERSION = "%s.%s.%s.%s%s" % (self.VER_MAJOR, - self.VER_MINOR, - self.VER_RELEASE, - self.VER_SUBREL, - self.VER_FLAGS) + self.VERSION = "%s.%s.%s%s" % (self.VER_MAJOR, + self.VER_MINOR, + self.VER_RELEASE, + self.VER_FLAGS) self.WXDLLVER = '%d%d' % (self.VER_MAJOR, self.VER_MINOR) @@ -755,7 +754,7 @@ def getSvnRev(): except: return None if rev != 'exported': - svnrev = "r" + rev.split(':')[0] + svnrev = rev.split(':')[0] return svnrev def _getGitSvnRevision(): @@ -766,7 +765,7 @@ def getSvnRev(): return None for line in info.splitlines(): if line.startswith('Revision:'): - svnrev = "r" + line.split(' ')[-1] + svnrev = line.split(' ')[-1] break return svnrev diff --git a/buildtools/version.py b/buildtools/version.py index 0e0181cf..f7a52208 100644 --- a/buildtools/version.py +++ b/buildtools/version.py @@ -14,5 +14,30 @@ VER_MAJOR = 3 # The first three must match wxWidgets VER_MINOR = 0 VER_RELEASE = 1 -VER_SUBREL = 0 # wxPython release num for x.y.z release of wxWidgets -VER_FLAGS = "" # release flags, such as prerelease or RC num, etc. +VER_FLAGS = "" # wxPython release flags + +# Set the VER_FLAGS component according to the following patterns. These +# should help us to better conform to the setuptools and/or PEP-0386 notions +# of version numbers. +# +# "" for final release builds +# +# "-1" for numbered post releases, such as when there are +# additional wxPython releases for the same wxWidgets +# release. TDB: use - or .post or ? +# +# ".dev12345" for daily snapshot builds, by default this is automatically +# pulled from the REV.txt file made by the setrev command, +# if it exists, and is appended to VER_FLAGS +# +# "a1" for official alpha releases +# "b1" for beta relases +# "rc1" for release candidate releases +# +# "-1a1" For alpha releases of a numbered post release, (betas, etc. +# of numbered post releases can be done the same way) +# +# See also: +# +# http://pythonhosted.org/setuptools/setuptools.html +# http://www.python.org/dev/peps/pep-0386/ \ No newline at end of file diff --git a/demo/version.py b/demo/version.py index 9201f60f..52006851 100644 --- a/demo/version.py +++ b/demo/version.py @@ -1,3 +1,3 @@ # This file was generated by Phoenix's wscript. -VERSION_STRING = '3.0.1.0' +VERSION_STRING = '3.0.1' diff --git a/docs/MigrationGuide.txt b/docs/MigrationGuide.txt index 8fb419d2..7ffd5117 100644 --- a/docs/MigrationGuide.txt +++ b/docs/MigrationGuide.txt @@ -19,6 +19,29 @@ general patterns of the changes will be documented. Most proggrammers should then be able to work out the details for themselves. +Version Numbers +--------------- + +Classic wxPython used version numbers with 4 components, in order to be able +to specify the exact version of wxWidgets used (3 version number components) +and an additional component to allow for multiple wxPython releases for each +wxWidgets release. While this version numbering works okay and solves a +specific need that wxPython had, it does not follow the common version +numbering pattern that probably 99% of other software packages use and so it +is non-intuitive for most users, and probably more importantly, it does not +fit well with the standards set by setuptools or PEP 0386. + +So Pheonix will be moving to a 3 component version number, possibly with an +added version tag on the end. Once again the 3 componenets of the version +number will match the wxWidgets version number, and the version tag will be +used to convey additional information specific to the wxPython Phoenix build, +including development snapshots, alpha or beta reelases, and "numbered post +release builds". The latter is what will take the place of Classic's 4 +version number component and is what will be used to version any wxPython +Phoenix builds that may happen in bewtween official wxWidgets releases. See +buildtools/version.py in the Phoenix build tree for more details. + + Overloaded Functions -------------------- diff --git a/etg/defs.py b/etg/defs.py index 7503f57b..eb5c6b22 100644 --- a/etg/defs.py +++ b/etg/defs.py @@ -71,24 +71,18 @@ def run(): class wxExecuteEnv; """)) - - # TBD: I've always disliked the WXK_* names. Should I rename all the items - # in the wxKeyCode enum to be KEY_* names? - - + # Add some code for getting the version numbers module.addCppCode(""" #include const int MAJOR_VERSION = wxMAJOR_VERSION; const int MINOR_VERSION = wxMINOR_VERSION; const int RELEASE_NUMBER = wxRELEASE_NUMBER; - const int SUBRELEASE_NUMBER = wxSUBRELEASE_NUMBER; """) module.addItem(etgtools.WigCode(""" const int MAJOR_VERSION; const int MINOR_VERSION; const int RELEASE_NUMBER; - const int SUBRELEASE_NUMBER; """)) module.addPyCode("BG_STYLE_CUSTOM = BG_STYLE_PAINT") diff --git a/wscript b/wscript index d9f2d01f..c5352c2a 100644 --- a/wscript +++ b/wscript @@ -407,9 +407,8 @@ def build(bld): "VERSION_STRING = '%(VERSION)s'\n" "MAJOR_VERSION = %(VER_MAJOR)s\n" "MINOR_VERSION = %(VER_MINOR)s\n" - "RELEASE_NUMBER = %(VER_RELEASE)s\n" - "SUBRELEASE_NUMBER = %(VER_SUBREL)s\n\n" - "VERSION = (MAJOR_VERSION, MINOR_VERSION, RELEASE_NUMBER, SUBRELEASE_NUMBER, '%(VER_FLAGS)s')\n" + "RELEASE_NUMBER = %(VER_RELEASE)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(