def identify_zinc_jars(zinc_classpath): """Find the named jars in the zinc classpath. TODO: Make these mappings explicit instead of deriving them by jar name heuristics. """ ret = OrderedDict() ret.update(ZincUtils.identify_jars(ZincUtils.zinc_jar_names, zinc_classpath)) return ret
def identify_zinc_jars(zinc_classpath): """Find the named jars in the zinc classpath. TODO: Make these mappings explicit instead of deriving them by jar name heuristics. """ ret = OrderedDict() ret.update(ZincUtils.identify_jars(ZincUtils.ZINC_JAR_NAMES, zinc_classpath)) return ret
def identify_zinc_jars(zinc_classpath): """Find the named jars in the zinc classpath. TODO: When profiles migrate to regular pants jar() deps instead of ivy.xml files we can make these mappings explicit instead of deriving them by jar name heuristics. """ ret = OrderedDict() ret.update(ZincUtils.identify_jars(ZincUtils.zinc_jar_names, zinc_classpath)) return ret
def identify_zinc_jars(zinc_classpath): """Find the named jars in the zinc classpath. TODO: When profiles migrate to regular pants jar() deps instead of ivy.xml files we can make these mappings explicit instead of deriving them by jar name heuristics. """ ret = OrderedDict() ret.update(ZincUtils.identify_jars(ZincUtils.zinc_jar_names, zinc_classpath)) return ret
def identify_zinc_jars(compiler_classpath, zinc_classpath): """Find the named jars in the compiler and zinc classpaths. TODO: When profiles migrate to regular pants jar() deps instead of ivy.xml files we can make these mappings explicit instead of deriving them by jar name heuristics. """ ret = OrderedDict() ret.update(ScalaCompile.identify_jars(ScalaCompile.compiler_jar_names, compiler_classpath)) ret.update(ScalaCompile.identify_jars(ScalaCompile.zinc_jar_names, zinc_classpath)) return ret
def identify_zinc_jars(compiler_classpath, zinc_classpath): """Find the named jars in the compiler and zinc classpaths. TODO: When profiles migrate to regular pants jar() deps instead of ivy.xml files we can make these mappings explicit instead of deriving them by jar name heuristics. """ ret = OrderedDict() ret.update(ScalaCompile.identify_jars(ScalaCompile.compiler_jar_names, compiler_classpath)) ret.update(ScalaCompile.identify_jars(ScalaCompile.zinc_jar_names, zinc_classpath)) return ret
def test_default_maybe_list(): HELLO_WORLD = ['hello', 'world'] assert maybe_list('hello') == ['hello'] assert maybe_list(('hello', 'world')) == HELLO_WORLD assert maybe_list(['hello', 'world']) == HELLO_WORLD assert maybe_list(OrderedSet(['hello', 'world', 'hello'])) == HELLO_WORLD assert maybe_list(s for s in ('hello', 'world')) == HELLO_WORLD od = OrderedDict(hello=1) od.update(world=2) assert maybe_list(od) == HELLO_WORLD assert maybe_list([]) == [] assert maybe_list(()) == [] assert maybe_list(set()) == [] with pytest.raises(ValueError): maybe_list(123) with pytest.raises(ValueError): maybe_list(['hello', 123]) assert maybe_list(['hello', 123], expected_type=(str, int)) == ['hello', 123] assert maybe_list(['hello', 123], expected_type=(int, str)) == ['hello', 123]
def test_default_maybe_list(): HELLO_WORLD = ['hello', 'world'] assert maybe_list('hello') == ['hello'] assert maybe_list(('hello', 'world')) == HELLO_WORLD assert maybe_list(['hello', 'world']) == HELLO_WORLD assert maybe_list(OrderedSet(['hello', 'world', 'hello'])) == HELLO_WORLD assert maybe_list(s for s in ('hello', 'world')) == HELLO_WORLD od = OrderedDict(hello=1) od.update(world=2) assert maybe_list(od) == HELLO_WORLD assert maybe_list([]) == [] assert maybe_list(()) == [] assert maybe_list(set()) == [] with pytest.raises(ValueError): maybe_list(123) with pytest.raises(ValueError): maybe_list(['hello', 123]) assert maybe_list(['hello', 123], expected_type=(str, int)) == ['hello', 123] assert maybe_list(['hello', 123], expected_type=(int, str)) == ['hello', 123]