goalie.is_package_version¶
- goalie.is_package_version(x: str, version: str, op: str = '>=') bool¶
Check whether an installed package satisfies a version constraint.
- Parameters:
- Returns:
Trueif the installed version satisfies the constraint.Falseif the package is not installed.- Return type:
- Raises:
ValueError – If
opis not one of the supported operators.
Examples
>>> isinstance(is_package_version("goalie", "0.0.1"), bool) True >>> is_package_version("nonexistent_pkg_xyz_abc", "1.0.0") False