def get_package_from_file(cls, file_path: Path) -> "Package": try: package = PackageInfo.from_path(path=file_path).to_package( root_dir=file_path) except PackageInfoError: raise RuntimeError( f"Unable to determine package info from path: {file_path}") return package
def get_package_from_file(cls, file_path): # type: (Path) -> Package try: package = PackageInfo.from_path(path=file_path).to_package( root_dir=file_path) except PackageInfoError: raise RuntimeError( "Unable to determine package info from path: {}".format( file_path)) return package