summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-08-20 13:18:39 +0200
committerValentin David <valentin.david@codethink.co.uk>2018-09-26 16:26:21 +0200
commita3c298a7fef83b0a53fe7f393aaf75ddfa7ce8ee (patch)
treeb57546f5606dda7bf7ea7fcdc8a4e8c1f4da4bea
parentfdbf9be1ecf04fbc56c085a5f0a1633a06f61805 (diff)
downloadbuildstream-a3c298a7fef83b0a53fe7f393aaf75ddfa7ce8ee.tar.gz
Add 'show' command to setup.py to used show versions of dependencies
-rwxr-xr-xsetup.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 405a39061..1bb291b47 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