1 import org.apache.tools.ant.taskdefs.condition.Os
4 id "com.jetbrains.python.envs" version "0.0.6"
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"]
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"
18 conda "django18", "2.7", ["django==1.6"]
19 textfile "django18/tags.txt", "django"
21 conda "django17", "2.7", ["django==1.7"]
22 textfile "django17/tags.txt", "django\nskeletons"
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"
27 if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
28 // jython "jython25", []
29 // textfile "jython25/tags.txt", "jython"
31 // conda "pyqt5", "2.7", ["python-qt5"]
32 // textfile "pyqt5/tags.txt", "pyqt5"
35 conda "django_latest", "3.5", ["django"]
36 textfile "django_latest/tags.txt", "django"
39 if (new File(envs.envsDirectory, "django_latest").exists() &&
40 new File(envs.envsDirectory, "django_latest").lastModified()<System.currentTimeMillis() - 24*60*60*1000) {
42 println "Cleaning django_latest at" + new File(envs.envsDirectory, "django_latest")
43 delete new File(envs.envsDirectory, "django_latest")
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