PY-19015: Use latest tox for tests
[idea/community.git] / python / setup-test-environment / build.gradle
1 import org.apache.tools.ant.taskdefs.condition.Os
2
3 plugins {
4   id "com.jetbrains.python.envs" version "0.0.6"
5 }
6
7
8 envs {
9   bootstrapDirectory = new File(System.getenv().getOrDefault("PYCHARM_PYTHONS", new File(buildDir, 'pythons').path))
10   envsDirectory = new File(System.getenv().getOrDefault("PYCHARM_PYTHON_VIRTUAL_ENVS", new File(buildDir, 'envs').path))
11   minicondaVersion = 'latest'
12   packages = ["pip", "setuptools"]
13   _64Bits = true
14
15   conda "django19", "2.7", ["django==1.9", "tox", "nose", "pytest", "behave", "lettuce>=0.2.22"]
16   textfile "django19/tags.txt", "django\nnose\npytest\nbehave\nlettuce\npackaging\ntox"
17
18   conda "django18", "2.7", ["django==1.6"]
19   textfile "django18/tags.txt", "django"
20
21   conda "django17", "2.7", ["django==1.7"]
22   textfile "django17/tags.txt", "django\nskeletons"
23   
24   conda "python34", "3.4", ["ipython==2.1", "django==1.6", "behave", "jinja2", "tox>=2.0", "pandas"]
25   textfile "python34/tags.txt", "python3\nipython\nipython200\nskeletons\ndjango\nbehave\ntox\njinja2\npython34\npackaging\npandas"
26
27   if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
28 //    jython "jython25", []
29 //    textfile "jython25/tags.txt", "jython"
30     
31 //    conda "pyqt5", "2.7", ["python-qt5"]
32 //    textfile "pyqt5/tags.txt", "pyqt5"
33   }
34
35   conda "django_latest", "3.5", ["django"]
36   textfile "django_latest/tags.txt", "django"
37 }
38
39 if (new File(envs.envsDirectory, "django_latest").exists() && 
40     new File(envs.envsDirectory, "django_latest").lastModified()<System.currentTimeMillis() - 24*60*60*1000) {
41   // older then a day
42   println "Cleaning django_latest at" + new File(envs.envsDirectory, "django_latest")
43   delete new File(envs.envsDirectory, "django_latest")
44 }
45
46 if (System.getenv("NO_CLEAN") == null && envs.envsDirectory.exists() &&
47     envs.envsDirectory.lastModified()<project.buildscript.sourceFile.lastModified()) {
48   // clean the cache if the build script if modified later
49   println "Cleaning cached environments at " + envs.envsDirectory
50   delete envs.envsDirectory
51   println "Cleaning cached pythons at " + envs.bootstrapDirectory
52   delete envs.bootstrapDirectory
53 }