def METHOD_NAME(env):
    result = []
    p = PlatformFactory.from_env(env)
    for pkg in p.get_installed_packages():
        result.append(
            dict(
                env=env,
                pm=p.pm,
                pkg=pkg,
                spec=p.get_package_spec(pkg.metadata.name),
            )
        )
    return sorted(result, key=lambda item: item["pkg"].metadata.name)