This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch valentindavid/show_versions-1.2
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit dfa68ba9dc97ae5d2d999366c2f76795c14108b7
Author: Valentin David <[email protected]>
AuthorDate: Mon Aug 20 13:18:39 2018 +0200

    Add 'show' command to setup.py to used show versions of dependencies
---
 setup.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/setup.py b/setup.py
index a0686eb..384efe2 100755
--- a/setup.py
+++ b/setup.py
@@ -171,6 +171,29 @@ def get_args(cls, dist, header=None):
 ScriptWriter.get_args = get_args
 
 
+class ShowVersions(Command):
+    description = 'show package versions used'
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def run(self):
+        import io
+        out = io.StringIO()
+        out.write("Install dependencies:\n")
+        for r in 
self.distribution.fetch_build_eggs(self.distribution.install_requires):
+            out.write("  {}\n".format(r))
+        out.write("\n")
+        out.write("Test dependencies:\n")
+        for r in 
self.distribution.fetch_build_eggs(self.distribution.tests_require):
+            out.write("  {}\n".format(r))
+        print(out.getvalue())
+
+
 #####################################################
 #         gRPC command for code generation          #
 #####################################################
@@ -220,6 +243,7 @@ class BuildGRPC(Command):
 def get_cmdclass():
     cmdclass = {
         'build_grpc': BuildGRPC,
+        'show': ShowVersions,
     }
     cmdclass.update(versioneer.get_cmdclass())
     return cmdclass

Reply via email to