def write_lockfile(
        self, toml_data: Any = None, show_message: bool = True, write: bool = True, **_kwds: Any
    ) -> None:
        """Write the lock file to disk."""
        if _kwds:  # pragma: no cover
            deprecation_warning("Extra arguments have been moved to `format_lockfile` function", stacklevel=2)
        if toml_data is not None:  # pragma: no cover
            deprecation_warning(
                "Passing toml_data to write_lockfile is deprecated, please use `format_lockfile` instead", stacklevel=2
            )
            self.lockfile.set_data(toml_data)
        self.lockfile.update_hash(self.pyproject.content_hash("sha256"))
        if write and self.enable_write_lockfile:
            self.lockfile.write(show_message)
Write the lock file to disk.
src/pdm/project/core.py