Exemplo n.º 1
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)

    py3_projects = pypi.all_py3_projects()
    all_projects = pypi.all_projects()

    for dependency in dependencies:
        if dependency in all_projects and dependency not in py3_projects:
            return False
    return True
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 = []
    dependencies.extend(main.projects_from_requirements(requirements_paths))
    dependencies.extend(main.projects_from_metadata(metadata))
    dependencies.extend(projects)

    manual_overrides = pypi.manual_overrides()

    for dependency in dependencies:
        if dependency in manual_overrides:
            continue
        elif not pypi.supports_py3(dependency):
            return False
    return True
Exemplo n.º 3
0
 def test_metadata(self):
     got = ciu_main.projects_from_metadata(EXAMPLE_METADATA)
     self.assertEqual(set(got), self.expected_metadata)
Exemplo n.º 4
0
 def test_multiple_metadata(self):
     got = ciu_main.projects_from_metadata(
         [EXAMPLE_METADATA, EXAMPLE_EXTRA_METADATA])
     want = self.expected_metadata.union(self.expected_extra_metadata)
     self.assertEqual(set(got), want)
Exemplo n.º 5
0
 def test_metadata(self):
     got = ciu_main.projects_from_metadata([EXAMPLE_METADATA])
     self.assertEqual(set(got), self.expected_metadata)
Exemplo n.º 6
0
 def test_multiple_metadata(self):
     got = ciu_main.projects_from_metadata([EXAMPLE_METADATA,
                                            EXAMPLE_EXTRA_METADATA])
     want = self.expected_metadata.union(self.expected_extra_metadata)
     self.assertEqual(set(got), want)