Search in sources :

Example 1 with PythonEnvsExtension

use of com.jetbrains.python.envs.PythonEnvsExtension in project curiostack by curioswitch.

the class CuriostackPlugin method setupPyenvs.

private static void setupPyenvs(Project rootProject) {
    PythonEnvsExtension envs = rootProject.getExtensions().getByType(PythonEnvsExtension.class);
    Path pythonDir = CommandUtil.getPythonDir(rootProject);
    envs.setBootstrapDirectory(pythonDir.resolve("bootstrap").toFile());
    envs.setEnvsDirectory(pythonDir.resolve("envs").toFile());
    ImmutableList.Builder<String> condaPackages = ImmutableList.<String>builder().add("git").add("automake").add("autoconf").add("make");
    if (Os.isFamily(Os.FAMILY_MAC)) {
        condaPackages.add("clang_osx-64", "clangxx_osx-64", "gfortran_osx-64");
    } else if (Os.isFamily(Os.FAMILY_UNIX)) {
        condaPackages.add("gcc_linux-64", "gxx_linux-64", "gfortran_linux-64");
    }
    envs.conda("miniconda2", "Miniconda2-4.4.10", condaPackages.build().stream().map(envs::condaPackage).collect(toImmutableList()));
    envs.condaenv("build", "2.7", "miniconda2");
    envs.condaenv("dev", "2.7", "miniconda2");
    rootProject.getTasks().create("pythonSetup", t -> t.dependsOn("build_envs"));
}
Also used : Path(java.nio.file.Path) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ImmutableList(com.google.common.collect.ImmutableList) PythonEnvsExtension(com.jetbrains.python.envs.PythonEnvsExtension)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1 PythonEnvsExtension (com.jetbrains.python.envs.PythonEnvsExtension)1 Path (java.nio.file.Path)1