venv_management.utilities module
Utility functions.
Summary
Functions:
Determine whether two versions are equal. |
|
Make a command-line argument string specifing whether and which verison of a package to install. |
|
Convert a string representation of truth to true (1) or false (0). |
Reference
- venv_management.utilities.compatible_versions(actual_version: str, required_version: str) bool [source]
Determine whether two versions are equal.
Only the dot separated elements in common are taken into account, so actual “3.7.4” compared with “3.7” will return True.
- Parameters
actual_version – A dot separated version.
required_version – A dot separated version.
- Returns
True if the actual_version is compatible with the required_version, otherwise False.
- venv_management.utilities.parse_package_arg(name, arg)[source]
Make a command-line argument string specifing whether and which verison of a package to install.
- Parameters
name – The name of the package.
arg – True if the package is required, False if the package is not required, or a string containing a version number if a specific version of the package is required.
- Returns
A string which can be used as an argument to the virtualenv command.