beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rober...@apache.org
Subject [1/3] incubator-beam git commit: Improving error of missing sdk_location
Date Mon, 31 Oct 2016 16:04:22 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk 00b17e542 -> ef01140d6


Improving error of missing sdk_location


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/a68c2461
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/a68c2461
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/a68c2461

Branch: refs/heads/python-sdk
Commit: a68c24619a4d9290ba75e8d3b58ac6716057cec8
Parents: 00b17e5
Author: Pablo <pabloem@google.com>
Authored: Wed Oct 26 15:50:06 2016 -0700
Committer: Robert Bradshaw <robertwb@gmail.com>
Committed: Mon Oct 31 09:04:04 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/utils/dependency.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/a68c2461/sdks/python/apache_beam/utils/dependency.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/utils/dependency.py b/sdks/python/apache_beam/utils/dependency.py
index ab311a0..04f869a 100644
--- a/sdks/python/apache_beam/utils/dependency.py
+++ b/sdks/python/apache_beam/utils/dependency.py
@@ -435,7 +435,13 @@ def _stage_dataflow_sdk_tarball(sdk_remote_location, staged_path, temp_dir):
     _dependency_file_copy(sdk_remote_location, staged_path)
   elif sdk_remote_location == 'pypi':
     logging.info('Staging the SDK tarball from PyPI to %s', staged_path)
-    _dependency_file_copy(_download_pypi_sdk_package(temp_dir), staged_path)
+    import pkg_resources as pkg
+    try:
+      _dependency_file_copy(_download_pypi_sdk_package(temp_dir), staged_path)
+    except pkg.DistributionNotFound:
+      raise RuntimeError('Unable to stage SDK tarball. '
+                         'Provide --sdk_location, check remote location, '
+                         'or provide google-cloud-dataflow repository.')
   else:
     raise RuntimeError(
         'The --sdk_location option was used with an unsupported '


Mime
View raw message