Skip to content

Commit

Permalink
Deal more directly with building of windows installers
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomac committed Jun 1, 2012
1 parent 39d619a commit 7199ef3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
9 changes: 8 additions & 1 deletion BUILD.rst
Expand Up @@ -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 <python 2.6 path> <python 2.7 path>


Publishing a New Release
------------------------
Expand Down
20 changes: 15 additions & 5 deletions build_dist.py
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 7199ef3

Please sign in to comment.