Make watcherclient/shell.py reproducible

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
python-watcherclient could not be built reproducibly.

This is because the documentation generates automatic documentation for
the "main()" entrypoint method's arguments, one of which is "sys.argv".
During document generation this results in documentation examples like:

   def main(argv=['-b', 'html', 'doc/source',
      '«ABSOLUTE_BUILD_DIR»/debian/python-watcherclient-doc/usr/.../html']):

… etc. Patch attached that sets "None" instead but retains the existing
fallback logic.

 [0] https://reproducible-builds.org/

Please note that this was reported in the Debian tracker:
https://bugs.debian.org/960607

and that the fix was applied to the Debian package.

Change-Id: I502bb2d11d90ce4c46c14904a8c048ea824f11d5
This commit is contained in:
Thomas Goirand 2021-12-28 19:32:07 +01:00
parent 765701da39
commit 834ab29878

@ -203,7 +203,9 @@ class WatcherShell(app.App):
LOG.info("END return value: %s", ret_val)
def main(argv=sys.argv[1:]):
def main(argv=None):
if argv is None:
argv = sys.argv[1:]
watcher_app = WatcherShell()
return watcher_app.run(argv)