aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/distrib/python/submit.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/distrib/python/submit.py')
-rwxr-xr-xtools/distrib/python/submit.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tools/distrib/python/submit.py b/tools/distrib/python/submit.py
index dffbefd5fe..9b012be672 100755
--- a/tools/distrib/python/submit.py
+++ b/tools/distrib/python/submit.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python2.7
-# Copyright 2015, Google Inc.
+# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -55,11 +55,19 @@ parser.add_argument(
help='Password to authenticate with the repository. Not needed if you have '
'configured your .pypirc to include your password.'
)
+parser.add_argument(
+ '--bdist', '-b', action='store_true',
+ help='Generate a binary distribution (wheel) for the current OS.'
+)
+parser.add_argument(
+ '--dist-args', type=str,
+ help='Additional arguments to pass to the *dist setup.py command.'
+)
args = parser.parse_args()
# Move to the root directory of Python GRPC.
pkgdir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
- '../../../src/python/grpcio')
+ '../../../')
# Remove previous distributions; they somehow confuse twine.
try:
shutil.rmtree(os.path.join(pkgdir, 'dist/'))
@@ -73,7 +81,12 @@ cmd = ['python', 'setup.py', 'build_ext', '--inplace']
subprocess.call(cmd, cwd=pkgdir, env=build_env)
# Make the push.
-cmd = ['python', 'setup.py', 'sdist']
+if args.bdist:
+ cmd = ['python', 'setup.py', 'bdist_wheel']
+else:
+ cmd = ['python', 'setup.py', 'sdist']
+if args.dist_args:
+ cmd += args.dist_args.split()
subprocess.call(cmd, cwd=pkgdir)
cmd = ['twine', 'upload', '-r', args.repository]