def _is_compatible_wheel_filename()

in aws_lambda_builders/workflows/python_pip/packager.py [0:0]


    def _is_compatible_wheel_filename(self, filename):
        wheel = filename[:-4]
        lambda_runtime_abi = get_lambda_abi(self.runtime)
        for implementation, abi, platform in self._iter_all_compatibility_tags(wheel):
            if not self._is_compatible_platform_tag(lambda_runtime_abi, platform):
                continue

            # Verify that the ABI is compatible with lambda. Either none or the
            # correct type for the python version cp27mu for py27 and cp36m for
            # py36.
            if abi == "none":
                return True
            prefix_version = implementation[:3]
            if prefix_version == "cp3":
                # Deploying python 3 function which means we need cp37m abi
                # We can also accept abi3 which is the CPython 3 Stable ABI and
                # will work on any version of python 3.
                if abi in (lambda_runtime_abi, "abi3"):
                    return True
        # Don't know what we have but it didn't pass compatibility tests.
        return False