From 7199ef395458b514eb6c2ff51983fe675e9d8211 Mon Sep 17 00:00:00 2001 From: Ryan Tomac Date: Fri, 1 Jun 2012 07:48:24 -0700 Subject: [PATCH] Deal more directly with building of windows installers --- BUILD.rst | 9 ++++++++- build_dist.py | 20 +++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/BUILD.rst b/BUILD.rst index 8c2731f70..08fd81d0a 100644 --- a/BUILD.rst +++ b/BUILD.rst @@ -85,10 +85,17 @@ This script will: - Generate source distribution packages in .tar.gz and .zip formats - Generate Python eggs for Python 2.6 and 2.7 -- Generate binary installers for Windows x86 and x64 +- Generate binary installers for Windows x86 and x64 (if run on Windows) - Generate a demo distribution package in .zip format. - Re-generate keyword documentation in doc folder +Note: The Windows installers will only be built if the script is run on +a Windows machine. If the rest of the distribution has been built on +a non-Windows machine and you want to build just the Windows installers, +use the --winonly flag:: + + python build_dist.py --winonly + Publishing a New Release ------------------------ diff --git a/build_dist.py b/build_dist.py index dab36e865..f0b5d5239 100644 --- a/build_dist.py +++ b/build_dist.py @@ -13,8 +13,13 @@ def main(): parser.add_argument('py_26_path', action='store', help='Python 2.6 executbale file path') parser.add_argument('py_27_path', action='store', help='Python 2.7 executbale file path') parser.add_argument('--release', action='store_true') + parser.add_argument('--winonly', action='store_true') args = parser.parse_args() + if args.winonly: + run_builds(args) + return + clear_dist_folder() run_register(args) run_builds(args) @@ -37,11 +42,16 @@ def run_register(args): def run_builds(args): print - _run_setup(args.py_27_path, "sdist", [ "--formats=gztar,zip" ], args.release) - _run_setup(args.py_26_path, "bdist_egg", [], args.release) - _run_setup(args.py_27_path, "bdist_egg", [], args.release) - _run_setup(args.py_27_path, "bdist_wininst", [ "--plat-name=win32" ], args.release) - _run_setup(args.py_27_path, "bdist_wininst", [ "--plat-name=win-amd64" ], args.release) + if not args.winonly: + _run_setup(args.py_27_path, "sdist", [ "--formats=gztar,zip" ], args.release) + _run_setup(args.py_26_path, "bdist_egg", [], args.release) + _run_setup(args.py_27_path, "bdist_egg", [], args.release) + if os.name == 'nt': + _run_setup(args.py_27_path, "bdist_msi", [ "--plat-name=win32" ], args.release) + _run_setup(args.py_27_path, "bdist_msi", [ "--plat-name=win-amd64" ], args.release) + else: + print + print("Windows binary installers cannot be built on this platform!") def run_demo_packaging(): import package