def info_packages() -> dict:
    """Get name and version of all installed packages."""
    packages = {}
    for dist in pkg_resources.working_set:
        package = dist.as_requirement()
        packages[package.key] = package.specs[0][1]
    return packages
Get name and version of all installed packages.
requirements/collect_env_details.py