def METHOD_NAME(self, base_dir):
    log.info(f"creating '{self.filename}' and adding '{base_dir}' to it")
    deferred = []
    for root, dirnames, filenames in os.walk(base_dir):
        # Sort the directory names so that `os.walk` will walk them in a
        # defined order on the next iteration.
        dirnames.sort()
        for name in sorted(filenames):
            path = os.path.normpath(os.path.join(root, name))
            if os.path.isfile(path):
                arcname = os.path.relpath(path, base_dir).replace(os.path.sep, "/")
                if arcname == self.record_path:
                    pass
                elif root.endswith(".dist-info"):
                    deferred.append((path, arcname))
                else:
                    self.write(path, arcname)
    deferred.sort()
    for path, arcname in deferred:
        self.write(path, arcname)