• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(46)  |  Call(32)  |  Derive(0)  |  Import(14)
Yield ``Requirement`` objects for each specification in `strs`

`strs` must be an instance of ``basestring``, or a (possibly-nested)
iterable thereof.

        def parse_requirements(strs):
    """Yield ``Requirement`` objects for each specification in `strs`

    `strs` must be an instance of ``basestring``, or a (possibly-nested)
    iterable thereof.
    """
    # create a steppable iterator, so we can handle \-continuations
    lines = iter(yield_lines(strs))

    def scan_list(ITEM,TERMINATOR,line,p,groups,item_name):

        items = []

        while not TERMINATOR(line,p):
            if CONTINUE(line,p):
                try:
                    line = lines.next(); p = 0
                except StopIteration:
                    raise ValueError(
                        "\\ must not appear on the last nonblank line"
                    )

            match = ITEM(line,p)
            if not match:
                raise ValueError("Expected "+item_name+" in",line,"at",line[p:])

            items.append(match.group(*groups))
            p = match.end()

            match = COMMA(line,p)
            if match:
                p = match.end() # skip the comma
            elif not TERMINATOR(line,p):
                raise ValueError(
                    "Expected ',' or end-of-list in",line,"at",line[p:]
                )

        match = TERMINATOR(line,p)
        if match: p = match.end()   # skip the terminator, if any
        return line, p, items

    for line in lines:
        match = DISTRO(line)
        if not match:
            raise ValueError("Missing distribution spec", line)
        project_name = match.group(1)
        p = match.end()
        extras = []

        match = OBRACKET(line,p)
        if match:
            p = match.end()
            line, p, extras = scan_list(
                DISTRO, CBRACKET, line, p, (1,), "'extra' name"
            )

        line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
        specs = [(op,safe_version(val)) for op,val in specs]
        yield Requirement(project_name, specs, extras)
        


src/r/e/reporter-lib-HEAD/packages/setuptools/setuptools/command/egg_info.py   reporter-lib(Download)
from setuptools.command.sdist import sdist
from distutils.util import convert_path
from distutils.filelist import FileList
from pkg_resources import parse_requirements, safe_name, parse_version, \
    safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename
from sdist import walk_revctrl
 
 
        try:
            list(
                parse_requirements('%s==%s' % (self.egg_name,self.egg_version))
            )
        except ValueError:
            raise DistutilsOptionError(

src/r/e/reporter-lib-HEAD/packages/setuptools/setuptools/dist.py   reporter-lib(Download)
def check_extras(dist, attr, value):
    """Verify that extras_require mapping is valid"""
    try:
        for k,v in value.items():
            list(pkg_resources.parse_requirements(v))
    except (TypeError,ValueError,AttributeError):
        raise DistutilsSetupError(
def check_requirements(dist, attr, value):
    """Verify that install_requires is a valid requirements list"""
    try:
        list(pkg_resources.parse_requirements(value))
    except (TypeError,ValueError):
        raise DistutilsSetupError(
            "%r must be a string or list of strings "
    def fetch_build_eggs(self, requires):
        """Resolve pre-setup requirements"""
        from pkg_resources import working_set, parse_requirements
        for dist in working_set.resolve(
            parse_requirements(requires), installer=self.fetch_build_egg
        ):
            working_set.add(dist)

src/b/a/badger-lib-HEAD/packages/setuptools/setuptools/command/egg_info.py   badger-lib(Download)
from setuptools.command.sdist import sdist
from distutils.util import convert_path
from distutils.filelist import FileList
from pkg_resources import parse_requirements, safe_name, parse_version, \
    safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename
from sdist import walk_revctrl
 
 
        try:
            list(
                parse_requirements('%s==%s' % (self.egg_name,self.egg_version))
            )
        except ValueError:
            raise DistutilsOptionError(

src/z/a/zamboni-lib-HEAD/lib/python/setuptools/command/egg_info.py   zamboni-lib(Download)
from setuptools.command.sdist import sdist
from distutils.util import convert_path
from distutils.filelist import FileList
from pkg_resources import parse_requirements, safe_name, parse_version, \
    safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename
from sdist import walk_revctrl
 
 
        try:
            list(
                parse_requirements('%s==%s' % (self.egg_name,self.egg_version))
            )
        except ValueError:
            raise DistutilsOptionError(

src/b/a/badger-lib-HEAD/packages/setuptools/setuptools/dist.py   badger-lib(Download)
def check_extras(dist, attr, value):
    """Verify that extras_require mapping is valid"""
    try:
        for k,v in value.items():
            list(pkg_resources.parse_requirements(v))
    except (TypeError,ValueError,AttributeError):
        raise DistutilsSetupError(
def check_requirements(dist, attr, value):
    """Verify that install_requires is a valid requirements list"""
    try:
        list(pkg_resources.parse_requirements(value))
    except (TypeError,ValueError):
        raise DistutilsSetupError(
            "%r must be a string or list of strings "
    def fetch_build_eggs(self, requires):
        """Resolve pre-setup requirements"""
        from pkg_resources import working_set, parse_requirements
        for dist in working_set.resolve(
            parse_requirements(requires), installer=self.fetch_build_egg
        ):
            working_set.add(dist)

src/z/a/zamboni-lib-HEAD/lib/python/setuptools/dist.py   zamboni-lib(Download)
def check_extras(dist, attr, value):
    """Verify that extras_require mapping is valid"""
    try:
        for k,v in value.items():
            list(pkg_resources.parse_requirements(v))
    except (TypeError,ValueError,AttributeError):
        raise DistutilsSetupError(
def check_requirements(dist, attr, value):
    """Verify that install_requires is a valid requirements list"""
    try:
        list(pkg_resources.parse_requirements(value))
    except (TypeError,ValueError):
        raise DistutilsSetupError(
            "%r must be a string or list of strings "
    def fetch_build_eggs(self, requires):
        """Resolve pre-setup requirements"""
        from pkg_resources import working_set, parse_requirements
        for dist in working_set.resolve(
            parse_requirements(requires), installer=self.fetch_build_egg
        ):
            working_set.add(dist)

src/g/o/gozerbot-0.9.2b1/gozerbot/eggs.py   gozerbot(Download)
    """
 
    try:
        from pkg_resources import DistributionNotFound, VersionConflict, working_set, parse_requirements, require
 
        if not latest.has_key(egg.project_name):
            latest[egg.project_name] = egg
 
        req = egg.as_requirement()
        reqstr = str(req)
        reqq = parse_requirements([reqstr.replace('==', '>='), ])

src/f/e/feedprovider-0.2.1/gozerlib/eggs.py   feedprovider(Download)
    """
 
    try:
        from pkg_resources import DistributionNotFound, VersionConflict, working_set, parse_requirements, require
 
        if not latest.has_key(egg.project_name):
            latest[egg.project_name] = egg
 
        req = egg.as_requirement()
        reqstr = str(req)
        reqq = parse_requirements([reqstr.replace('==', '>='), ])

src/d/i/distribute-0.6.14/setuptools/command/egg_info.py   distribute(Download)
from setuptools.command.sdist import sdist
from distutils.util import convert_path
from distutils.filelist import FileList
from pkg_resources import parse_requirements, safe_name, parse_version, \
    safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename
from sdist import walk_revctrl
 
 
        try:
            list(
                parse_requirements('%s==%s' % (self.egg_name,self.egg_version))
            )
        except ValueError:
            raise DistutilsOptionError(

src/d/i/distribute-0.6.14/setuptools/dist.py   distribute(Download)
def check_extras(dist, attr, value):
    """Verify that extras_require mapping is valid"""
    try:
        for k,v in value.items():
            list(pkg_resources.parse_requirements(v))
    except (TypeError,ValueError,AttributeError):
        raise DistutilsSetupError(
def check_requirements(dist, attr, value):
    """Verify that install_requires is a valid requirements list"""
    try:
        list(pkg_resources.parse_requirements(value))
    except (TypeError,ValueError):
        raise DistutilsSetupError(
            "%r must be a string or list of strings "
    def fetch_build_eggs(self, requires):
        """Resolve pre-setup requirements"""
        from pkg_resources import working_set, parse_requirements
        for dist in working_set.resolve(
            parse_requirements(requires), installer=self.fetch_build_egg
        ):
            working_set.add(dist)

  1 | 2  Next