def METHOD_NAME(self) -> None:
    preserved = {}
    if self.system_pyproject.exists():
        content = PyProjectTOML(self.system_pyproject).poetry_config
        for key in {"group", "source"}:
            if key in content:
                preserved[key] = content[key]
    package = ProjectPackage(name="poetry-instance", version=__version__)
    package.add_dependency(Dependency(name="poetry", constraint=f"{__version__}"))
    package.python_versions = ".".join(str(v) for v in self.env.version_info[:3])
    content = Factory.create_pyproject_from_package(package=package)
    for key in preserved:
        content["tool"]["poetry"][key] = preserved[key]  # type: ignore[index]
    pyproject = PyProjectTOML(self.system_pyproject)
    pyproject.file.write(content)