def test_no_case(self): # No cases should still give us a result with a single case in it. a = DummyPackage('pkgA', ['wibble']) self.index.add_pkg('python', '2.7.2') self.index.add_pkg('wibble', '3.5.0') r = special_case_version_matrix(a, self.index) self.assertEqual(r, set([()]))
def test_numpy_simplest_case(self): a = DummyPackage('pkgA', ['python', 'numpy']) self.index.add_pkg('numpy', '1.8.0', 'py27', depends=['python']) self.index.add_pkg('python', '2.7.2') r = special_case_version_matrix(a, self.index) self.assertEqual(r, set([(('python', '2.7'), ('numpy', '1.8')), ]) )
def test_constrained_python(self): a = DummyPackage('pkgA', ['python <3']) self.index.add_pkg('python', '2.7.2') self.index.add_pkg('python', '3.5.0') r = special_case_version_matrix(a, self.index) self.assertEqual(r, set(((('python', '2.7'), ), )) )
def test_numpy_repeated_python27(self): # Repeating python 2.7 will result in the latest version being found a = DummyPackage('pkgA', ['python', 'numpy']) self.index.add_pkg('numpy', '1.8.0', 'py27', depends=['python <3']) self.index.add_pkg('python', '2.7.2') self.index.add_pkg('python', '2.7.0') r = special_case_version_matrix(a, self.index) self.assertEqual(r, set([(('python', '2.7'), ('numpy', '1.8')), ]) )
def test_numpy_without_python(self): # Conda recipes which do not depend on python, but do on python, do # not have the full conda metadata, but still need to be handled. a = DummyPackage('pkgA', ['numpy']) self.index.add_pkg('numpy', '1.8.0', 'py27', depends=['python']) self.index.add_pkg('python', '2.7.2') r = special_case_version_matrix(a, self.index) self.assertEqual(r, set([(('python', '2.7'), ('numpy', '1.8')), ]) )
def test_dependency_on_py27(self): # If a dependency can't hit the python version, it should not # be considered a case. a = DummyPackage('pkgA', ['python', 'oldschool']) self.index.add_pkg('oldschool', '1.8.0', 'py27', depends=['python <3']) self.index.add_pkg('python', '2.7.2') self.index.add_pkg('python', '3.5.0') r = special_case_version_matrix(a, self.index) # No python 3 should be here. self.assertEqual(r, set([(('python', '2.7'), ), ]) )
def test_numpy_repeated_python(self): a = DummyPackage('pkgA', ['python', 'numpy']) self.index.add_pkg('numpy', '1.8.0', 'py27', depends=['python <3']) self.index.add_pkg('numpy', '1.8.0', 'py35', depends=['python']) self.index.add_pkg('numpy', '1.9.0', 'py35', depends=['python >=3']) self.index.add_pkg('python', '2.7.2') self.index.add_pkg('python', '3.5.0') r = special_case_version_matrix(a, self.index) self.assertEqual(r, set(((('python', '2.7'), ('numpy', '1.8')), (('python', '3.5'), ('numpy', '1.8')), (('python', '3.5'), ('numpy', '1.9')), )) )
metas = sort_dependency_order(metas) stdoutlog.debug('Metas sorted into the following order:\n{}\n---------' ''.format('\n'.join(meta.name() for meta in metas))) src_index = {} src_index = compute_source_indices(env_sources) index = resolve_index(src_index, env_sources) r = conda.resolve.Resolve(index) for meta in metas: stdoutlog.debug('Starting to look at: ', meta.name()) 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) # version_matrix = vn_matrix.filter_cases(version_matrix, index, env['packages']) 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) # src_index = compute_source_indices(env_sources) # index = resolve_index(src_index, env_sources)