示例#1
0
def version_satisfies_spec(spec, version):
    if not spec:
        return True
    if not version:
        return False
    if not isinstance(spec, SpecifierSet):
        spec = SpecifierSet(spec)
    if not isinstance(version, Version):
        version = Version(version)
    return spec.contains(version)
示例#2
0
    def __init__(self, name, version=None, url=None):
        self.name = name

        if version:
            try:
                version = ">=" + str(Version(version))
                self.version_not_a_spec = True
            except InvalidVersion:
                try:
                    version = str(SpecifierSet(version))
                except InvalidSpecifier:
                    raise ValueError(
                        "'%s' must be either PEP 0440 version or a version specifier set"
                    )

        self.version = version
        self.url = url
示例#3
0
import sys
from traceback import format_exc

from pybuilder import __version__ as pyb_version
from pybuilder.core import PluginDef
from pybuilder.errors import (MissingPluginException,
                              IncompatiblePluginException,
                              BuildFailedException
                              )
from pybuilder.pip_common import Version
from pybuilder.pip_utils import (version_satisfies_spec
                                 )
from pybuilder.utils import as_list

if pyb_version == "${dist_version}":  # This is the case of PyB bootstrap
    PYB_VERSION = Version('0.0.1.dev0')
else:
    PYB_VERSION = Version(pyb_version)


class PluginLoader(object):
    def __init__(self, logger):
        self.logger = logger

    def can_load(self, project, plugin_def):
        pass

    def load_plugin(self, project, plugin_defs):
        pass

    def install_plugin(self, project, plugin_defs):