@classmethod<EOL><INDENT>def from_package_versions(cls, package_versions: typing.List[PackageVersion], develop: bool):<DEDENT>
if not package_versions:<EOL><INDENT>return cls(develop=develop, packages={})<EOL><DEDENT>package_version_map = {}<EOL>for package_version in package_versions:<EOL><INDENT>if package_version.name in package_version_map:<EOL><INDENT>raise InternalError(f"<STR_LIT>")<EOL><DEDENT>package_version_map[package_version.name] = package_version<EOL>if develop != package_version.develop:<EOL><INDENT>raise InternalError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>return cls(develop=develop, packages=package_version_map)<EOL>
Create Packages instance from a list of packages in specific versions.