beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [1/2] incubator-beam git commit: Update juliaset example to support "pip install"
Date Sat, 25 Jun 2016 02:20:53 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk c526df5ce -> 21c819f81


Update juliaset example to support "pip install"


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

Branch: refs/heads/python-sdk
Commit: 7672ef7668cbe71f0bb8dfa2ffd9822a2c8fbf25
Parents: c526df5
Author: Charles Chen <ccy@google.com>
Authored: Fri Jun 17 13:36:32 2016 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Fri Jun 24 19:20:33 2016 -0700

----------------------------------------------------------------------
 .../examples/complete/juliaset/setup.py           | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/7672ef76/sdks/python/apache_beam/examples/complete/juliaset/setup.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/examples/complete/juliaset/setup.py b/sdks/python/apache_beam/examples/complete/juliaset/setup.py
index 639e424..589e47c 100644
--- a/sdks/python/apache_beam/examples/complete/juliaset/setup.py
+++ b/sdks/python/apache_beam/examples/complete/juliaset/setup.py
@@ -25,24 +25,22 @@ This behavior is triggered by specifying the --setup_file command line
option
 when running the workflow for remote execution.
 """
 
+from distutils.command.build import build as _build
 import subprocess
 
 import setuptools
-from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
 
 
-class bdist_egg(_bdist_egg):  # pylint: disable=invalid-name
-  """A bdist_egg command class that will be invoked during package install.
+# This class handles the pip install mechanism.
+class build(_build):  # pylint: disable=invalid-name
+  """A build command class that will be invoked during package install.
 
   The package built using the current setup.py will be staged and later
-  installed in the worker using `easy_install package'. This class will be
+  installed in the worker using `pip install package'. This class will be
   instantiated during install for this specific scenario and will trigger
   running the custom commands specified.
   """
-
-  def run(self):
-    self.run_command('CustomCommands')
-    _bdist_egg.run(self)
+  sub_commands = _build.sub_commands + [('CustomCommands', None)]
 
 
 # Some custom command to run during setup. The command is not essential for this
@@ -111,8 +109,8 @@ setuptools.setup(
     install_requires=REQUIRED_PACKAGES,
     packages=setuptools.find_packages(),
     cmdclass={
-        # Command class instantiated and run during easy_install scenarios.
-        'bdist_egg': bdist_egg,
+        # Command class instantiated and run during pip install scenarios.
+        'build': build,
         'CustomCommands': CustomCommands,
         }
     )


Mime
View raw message