# Path: ethronsoft/gcspypi/utilities/version.py
# def complete_version(v):
#     """adds missing '0' to a version that has less than 3 components
#     
#     Arguments:
#         v {str} -- The version to update
#     
#     Returns:
#         str -- The modified version
#     """
# 
#     tokens = [x for x in v.split(".") if x.strip()]
#     if len(tokens) > 3:
#         raise InvalidParameter("Invalid Version")
#     for i in range(3 - len(tokens)):
#         tokens.append("0")
#     return ".".join(tokens)
# 
# Path: ethronsoft/gcspypi/exceptions/boundary_errors.py
# class InvalidParameter(Exception):
#     pass
# 
# Path: ethronsoft/gcspypi/exceptions/state_errors.py
# class InvalidState(Exception):
#     pass


from ethronsoft.gcspypi.utilities.version import complete_version
from ethronsoft.gcspypi.exceptions import InvalidState, InvalidParameter
import os
        for r in requirements:
            self.requirements.add(r.replace("_","-"))

    @staticmethod
    def repo_name(pkg, filename):
        if not pkg.version:
            raise InvalidState("cannot formulate package repository-name for a package without version")
        return "{name}/{version}/{filename}".format(
            name=pkg.name,
            version=pkg.version,
            filename=os.path.split(filename)[1]
        )

    @staticmethod
    def from_text(text):
        if ">" in text or "<" in text:
            raise InvalidParameter("Cannot create a package with non deterministic version")
        if "==" in text:
            name, version = text.split("==")
            return Package(name.strip(), version.strip())
        else:
            return Package(text)

    def __str__(self):
        return self.full_name

    def __repr__(self): # pragma: no cover
        return "<Package {}>".format(str(self))

    def __eq__(self, o):

# Path: ethronsoft/gcspypi/utilities/version.py
# def complete_version(v):
#     """adds missing '0' to a version that has less than 3 components
#     
#     Arguments:
#         v {str} -- The version to update
#     
#     Returns:
#         str -- The modified version
#     """
# 
#     tokens = [x for x in v.split(".") if x.strip()]
#     if len(tokens) > 3:
#         raise InvalidParameter("Invalid Version")
#     for i in range(3 - len(tokens)):
#         tokens.append("0")
#     return ".".join(tokens)
# 
# Path: ethronsoft/gcspypi/exceptions/boundary_errors.py
# class InvalidParameter(Exception):
#     pass
# 
# Path: ethronsoft/gcspypi/exceptions/state_errors.py
# class InvalidState(Exception):
#     pass


# Path: ethronsoft/gcspypi/package/package.py
from ethronsoft.gcspypi.utilities.version import complete_version
from ethronsoft.gcspypi.exceptions import InvalidState, InvalidParameter
import os

        for r in requirements:
            self.requirements.add(r.replace("_","-"))

    @staticmethod
    def repo_name(pkg, filename):
        if not pkg.version:
            raise InvalidState("cannot formulate package repository-name for a package without version")
        return "{name}/{version}/{filename}".format(
            name=pkg.name,
            version=pkg.version,
            filename=os.path.split(filename)[1]
        )

    @staticmethod
    def from_text(text):
        if ">" in text or "<" in text:
            raise InvalidParameter("Cannot create a package with non deterministic version")
        if "==" in text:
            name, version = text.split("==")
            return Package(name.strip(), version.strip())
        else:
            return Package(text)

    def __str__(self):
        return self.full_name

    def __repr__(self): # pragma: no cover
        return "<Package {}>".format(str(self))

    def __eq__(self, o):

        if not o: return False