Add environments to PATH to make them discoverable by tox

Gradle now creates links for pythons: python -> python2.7
Tox may use this info to find correct interpreter, but envs need to be added to PATH

This branch depends on https://github.com/throwable-one/gradle-python-envs/commit/81bcdcbdce2361acb69e4fd156a626db730f4746
This commit is contained in:
Ilya.Kazakevich
2016-07-05 15:28:03 +03:00
parent a289888a1d
commit daeedb475f
2 changed files with 21 additions and 7 deletions
+7 -7
View File
@@ -1,7 +1,7 @@
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id "com.jetbrains.python.envs" version "0.0.6"
id "com.jetbrains.python.envs" version "0.0.7"
}
@@ -12,16 +12,16 @@ envs {
packages = ["pip", "setuptools"]
_64Bits = true
conda "django19", "2.7", ["django==1.9", "tox", "nose", "pytest", "behave", "lettuce>=0.2.22"]
conda "django19", "2.7", ["django==1.9", "tox", "nose", "pytest", "behave", "lettuce>=0.2.22"], true
textfile "django19/tags.txt", "django\nnose\npytest\nbehave\nlettuce\npackaging\ntox"
conda "django18", "2.7", ["django==1.6"]
conda "django18", "2.7", ["django==1.6"], false
textfile "django18/tags.txt", "django"
conda "django17", "2.7", ["django==1.7"]
conda "django17", "2.7", ["django==1.7"], false
textfile "django17/tags.txt", "django\nskeletons"
conda "python34", "3.4", ["ipython==2.1", "django==1.6", "behave", "jinja2", "tox>=2.0", "pandas"]
conda "python34", "3.4", ["ipython==2.1", "django==1.6", "behave", "jinja2", "tox>=2.0", "pandas"], true
textfile "python34/tags.txt", "python3\nipython\nipython200\nskeletons\ndjango\nbehave\ntox\njinja2\npython34\npackaging\npandas"
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
@@ -32,7 +32,7 @@ envs {
// textfile "pyqt5/tags.txt", "pyqt5"
}
conda "django_latest", "3.5", ["django"]
conda "django_latest", "3.5", ["django"], true
textfile "django_latest/tags.txt", "django"
}
+14
View File
@@ -20,6 +20,7 @@ import com.intellij.execution.testframework.sm.runner.SMTestProxy;
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.jetbrains.python.sdkTools.SdkCreationType;
import com.jetbrains.python.testing.tox.PyToxConfiguration;
import com.jetbrains.python.testing.tox.PyToxConfigurationFactory;
@@ -30,6 +31,7 @@ import org.jetbrains.annotations.Nullable;
import org.junit.Assert;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.function.Supplier;
@@ -362,6 +364,18 @@ public final class PyToxTest extends PyEnvTestCase {
private MyTestProcessRunner(final int timesToRerunFailedTests) {
super(PyToxConfigurationFactory.INSTANCE, PyToxConfiguration.class, timesToRerunFailedTests);
}
@Override
protected void configurationCreatedAndWillLaunch(@NotNull PyToxConfiguration configuration) throws IOException {
super.configurationCreatedAndWillLaunch(configuration);
// To help tox with all interpreters, we add all our environments to path
// Envs should have binaries like "python2.7" (with version included),
// and tox will find em: see tox_get_python_executable @ interpreters.py
final String join = StringUtil.join(getPythonRoots(), File.pathSeparator);
configuration.getEnvs().put("PATH", join);
}
}
private static final class InterpreterExpectations {