docs: def update_file(self, key, new_path):
          """Insert file *new_path* into the refpkg under *key*.
  
          The filename of *new_path* will be preserved in the refpkg
          unless it would conflict with a previously existing file, in
          which case a suffix is appended which makes it unique.  The
          previous file, if there was one, is left in the refpkg.  If
          you wish to delete it, see the ``strip`` method.
  
          The full path to the previous file referred to by *key* is
          returned, or ``None`` if *key* was not previously defined in
          the refpkg.
          """
          if key in self.contents['files']:
              old_path = self.resource_path(key)
          else:
              old_path = None
          self._add_file(key, new_path)
          with open(new_path, 'rb') as f:
              md5_value = md5file(f)
          self.contents['md5'][key] = md5_value
          self._log('Updated file: %s=%s' % (key, new_path))
          if key == 'tree_stats' and old_path:
              warnings.warn('Updating tree_stats, but not phylo_model.',
                            DerivedFileNotUpdatedWarning, stacklevel=2)
          return old_path