示例#1
0
    def build_deps_from_setup_py(self): # setup_requires
        """Same as runtime_deps_from_setup_py, but build dependencies.

        Returns:
            list of build dependencies of the package
        """
        return self.name_convert_deps_list(DependencyParser.deps_from_pyp_format(self.archive.find_list_argument('setup_requires'), runtime = False))
示例#2
0
    def runtime_deps_from_setup_py(self): # install_requires
        """ Returns list of runtime dependencies of the package specified in setup.py.

        Dependencies are in RPM SPECFILE format - see DependencyParser.dependency_to_rpm() for details, but names are already
        transformed according to current distro.

        Returns:
            list of runtime dependencies of the package
        """
        return self.name_convert_deps_list(DependencyParser.deps_from_pyp_format(self.archive.find_list_argument('install_requires'), runtime = True))
示例#3
0
    def runtime_deps_from_egg_info(self):
        """ Returns list of runtime dependencies of the package specified in EGG-INFO/requires.txt.

        Dependencies are in RPM SPECFILE format - see DependencyParser.dependency_to_rpm() for details, but names are already
        transformed according to current distro.

        Returns:
            list of runtime dependencies of the package
        """
        requires_txt = self.archive.get_content_of_file('EGG-INFO/requires.txt', True) or ''
        return self.name_convert_deps_list(DependencyParser.deps_from_pyp_format(requires_txt.splitlines()))
示例#4
0
 def test_dependency_to_rpm(self, d, r, expected):
     # we can't convert lists of lists into sets => compare len and contents
     rpm_deps = DP.dependency_to_rpm(R.parse(d), r)
     for dep in expected:
         assert dep in rpm_deps
     assert len(expected) == len(rpm_deps)