#1050619 nbclient: unreproducible output - iopub.* timestamps

#1050619#5
Date:
2023-08-27 09:17:31 UTC
From:
To:
By default, nbclient includes timestamps in its output, which makes
packages built with it (e.g. python-pandas-doc) unreproducible.

It provides a record_timing option to turn this off, but this didn't
work when I tried to use it (possibly it got dropped somewhere in the
chain between the source notebook and nbclient?)
https://salsa.debian.org/science-team/pandas/-/commit/b89ff25fee3b67f2149c266068295b4875ea5e07#72770524feb6622ddedb14db1cf0160322cb455a_115_123
https://salsa.debian.org/science-team/pandas/-/jobs/4613211
and we also generally prefer modifying the tool to accept the standard
"be reproducible" setting, instead of modifying every package that uses
that tool to set tool-specific "be reproducible" settings.

This might fix it, but has NOT been tested.  (I chose to disable the
timestamps when SOURCE_DATE_EPOCH is set, instead of setting them to
SOURCE_DATE_EPOCH, because they are plausibly intended for measuring how
long the code took to run, for which I'd rather have no answer than a
wrong answer of 0.)
--- a/nbclient/client.py
+++ b/nbclient/client.py
@@ -4,6 +4,7 @@ import atexit
  import base64
  import collections
  import datetime
+import os
  import re
  import signal
  import typing as t
@@ -222,7 +223,7 @@ class NotebookClient(LoggingConfigurable
      ).tag(config=True)

      record_timing: bool = Bool(
-        True,
+        False if os.getenv("SOURCE_DATE_EPOCH") else True,
          help=dedent(
              """
              If ``True`` (default), then the execution timings of each
cell will