Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Check all requirements and respond on mismatched ones

        def check_requirements(requirements_path):
    """
    Check all requirements and respond on mismatched ones
    """

    from pkg_resources import WorkingSet, DistributionNotFound, VersionConflict
    from setuptools.command.easy_install import main as install


    with open(requirements_path) as f_in:
        requirements = (line.rstrip() for line in f_in)
        requirements = (line for line in requirements if line[0]!='#') # Non-comment lines
        requirements = (line for line in requirements if not line.startswith('hg+')) # Non-hg+ lines
        requirements = (line for line in requirements if not line.startswith('git+')) # Non-hg+ lines
        requirements = list(line for line in requirements if line)

    working_set = WorkingSet()

    for requirement in requirements:

        if not requirement or requirement[0]=='#':
            continue

        ## Detecting if module is installed
        try:
            dep = working_set.require(requirement)
        except DistributionNotFound:
            print "DistributionNotFound for %s" % requirement
            #install([requirement])
        except VersionConflict, err:
            print "VersionConflict for %s" % requirement
        


src/d/j/django-djaboto-0.0.6a3/djaboto/management/commands/checkmix.py   django-djaboto(Download)
 
 
        djaboto.pve.check_requirements('requirements.txt')