Exemplo n.º 1
0
def check(projects):
    """Check the specified projects for Python 3 compatibility."""
    # Without this, the 'ciu' logger will emit nothing.
    logging.basicConfig(format='[%(levelname)s] %(message)s')

    log = logging.getLogger('ciu')
    log.info('{0} top-level projects to check'.format(len(projects)))
    print('Finding and checking dependencies ...')
    blockers = dependencies.blocking_dependencies(projects, pypi.all_pypy_projects())

    print('')
    for line in message(blockers):
        print(line)

    print('')
    for line in pprint_blockers(blockers):
        print(' ', line)
Exemplo n.º 2
0
def check(requirements_paths=[], metadata=[], projects=[]):
    """Return True if all of the specified dependencies have been ported to Python 3.

    The requirements_paths argument takes a sequence of file paths to
    requirements files. The 'metadata' argument takes a sequence of strings
    representing metadata. The 'projects' argument takes a sequence of project
    names.

    Any project that is not listed on PyPI will be considered ported.
    """
    dependencies = main.projects_from_requirements(requirements_paths)
    dependencies.extend(main.projects_from_metadata(metadata))
    dependencies.extend(projects)
    dependencies = set(name.lower() for name in dependencies)

    pypy_projects = pypi.all_pypy_projects()
    all_projects = pypi.all_projects()

    for dependency in dependencies:
        if dependency in all_projects and dependency not in pypy_projects:
            if not pypi.is_pure_python(dependency):
                return False
    return True
Exemplo n.º 3
0
 def test_all_pypy_projects_explicit_overrides(self):
     added_port = 'asdfasdfasdfadsffffdasfdfdfdf'
     projects = pypi.all_pypy_projects(set([added_port]))
     self.assertIn(added_port, projects)
Exemplo n.º 4
0
 def test_all_pypy_projects(self):
     projects = pypi.all_pypy_projects()
     self.assertGreater(len(projects), 300)
     self.assertTrue(all(project == project.lower() for project in projects))
     self.assertTrue(frozenset(pypi.overrides().keys()).issubset(projects))