def test_get_wheels_arch_all_pythons(self): arch = 'avx2' search_paths = [f'{self.wheelhouse}/{self.current_stack}/{arch}'] other = {'netCDF4': [], 'torch_cpu': []} for wheel_name, files in self.raw_filenames.items(): for file in files: other[wheel_name].append(avail_wheels.Wheel(f"{arch}/{file}")) ret = avail_wheels.get_wheels(paths=search_paths, pythons=avail_wheels.AVAILABLE_PYTHONS, names_versions=product('*', '*'), latest=False) self.assertEqual(ret, other)
def test_get_wheels_wrongversion_wildname_arch_python(self): arch = 'avx2' search_paths = [f"{self.wheelhouse}/{self.current_stack}/{arch}"] pythons = ['3.6'] wildname = "*CDF*" version = '2.3' other = {} ret = avail_wheels.get_wheels(paths=search_paths, pythons=pythons, names_versions=product([wildname], [version]), latest=False) self.assertEqual(ret, other)
def test_get_wheels_wildversion_wildname_arch_python(self): arch = 'avx2' search_paths = [f"{self.wheelhouse}/{self.current_stack}/{arch}"] pythons = ['3.6'] wildname = "*CDF*" version = '1.2.*' other = { 'netCDF4': [avail_wheels.Wheel(f"{arch}/{self.raw_filenames['netCDF4'][2]}")] } ret = avail_wheels.get_wheels(paths=search_paths, pythons=pythons, names_versions=product([wildname], [version]), latest=False) self.assertEqual(ret, other)
def test_get_wheels_exactname_arch_python(self): arch = 'avx2' search_paths = [f"{self.wheelhouse}/{self.current_stack}/{arch}"] pythons = ['3.6'] exactname = "netCDF4" other = { 'netCDF4': [ avail_wheels.Wheel( f"{arch}/{self.raw_filenames['netCDF4'][2]}"), avail_wheels.Wheel( f"{arch}/{self.raw_filenames['netCDF4'][3]}") ] } ret = avail_wheels.get_wheels(paths=search_paths, pythons=pythons, names_versions=product([exactname], '*'), latest=False) self.assertEqual(ret, other)