def test_numpy_version_filter(self): cases = ([('python', '2.7'), ('numpy', '1.8')], [('python', '2.7'), ('numpy', '1.9')], [('python', '3.5'), ('numpy', '1.8')], ) r = tuple(filter_cases(cases, self.index, extra_specs=['numpy 1.8.*'])) self.assertEqual(r, cases[::2])
def test_filter_not_in_index(self): cases = ([('python', '2.7'), ('numpy', '1.8')], [('python', '2.7'), ('numpy', '1.9')], [('python', '3.5'), ('numpy', '1.8')], ) r = tuple(filter_cases(cases, self.index, extra_specs=['not_a_package'])) self.assertEqual(r, cases)
def test_filter_to_a_version_that_doesnt_exist(self): cases = ([('python', '2.7'), ('numpy', '1.8')], [('python', '2.7'), ('numpy', '1.9')], [('python', '3.5'), ('numpy', '1.8')], ) with self.assertRaises(conda.resolve.NoPackagesFound): # TODO: The error message could be made more specific. tuple(filter_cases(cases, self.index, extra_specs=['numpy <1.0']))
# Build up the index for each package as we go. If we've just built # a package that this package needs, the index needs to be up to # date. src_index = compute_source_indices(env_sources) index = resolve_index(src_index, env_sources) with open(os.path.join(meta.path, 'source.json'), 'r') as fh: source = json.load(fh) source_name = source['name'] version_matrix = vn_matrix.special_case_version_matrix(meta, index) print 'BEFORE FILTERING: ', version_matrix # There is no point keeping the matrix entries which are not needed by the target envs. env_constraints_excluding_unbuilt = [spec for spec in env['packages'] if conda.resolve.MatchSpec(spec).name not in remaining_package_names] version_matrix = list(vn_matrix.filter_cases(version_matrix, index, env_constraints_excluding_unbuilt)) print 'AFTER FILTERING: ', version_matrix for case in vn_matrix.conda_special_versions(meta, index, version_matrix): if meta.dist() + '.tar.bz2' not in src_index[source_name]: stdoutlog.info('Building {} from {}.\n' ''.format(meta.name(), source_name)) with conda_build_croot_for_source(source_name): # print conda_bld_config.croot # print conda.config.rc['channels'] print 'BUILDING IN:', conda_bld_config.croot with conda_manifest.config.pipe_check_call(os.path.join(meta.path, 'build.{}.log'.format(conda.config.subdir))): # with fixed_get_index(index): build(meta, channels, test=True) # TODO: If the test fails, we should remove the build file. # build_null(meta)