for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from coala_decorators.decorators import generate_repr
@generate_repr()
class PackageRequirement:
"""
This class helps keeping track of bear requirements. It should simply
be appended to the REQUIREMENTS tuple inside the Bear class.
You can check whether the requirements are fulfilled using the check
method:
>>> PR = PackageRequirement('pip', 'coala_decorators', '0.2.1')
>>> PR.check()
Traceback (most recent call last):
...
NotImplementedError
def __init__(self, manager: str, package: str, version=""):
Constructs a new PackageRequirement.
:param manager: A string with the name of the manager (pip, npm, etc).
:param package: A string with the name of the package to be installed.
:param version: A number that contains the version. Leave empty to
install the latest.
self.manager = manager
self.package = package
self.version = version
def check(self):
Check if the requirement is satisfied.
:return: Returns True if satisfied, False if not.
raise NotImplementedError