<commit_before>[![official JetBrains project](http://jb.gg/badges/official-plastic.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)

Gradle Python Envs Plugin
========================

Gradle plugin to create Python envs.

This plugin is based on [gradle-miniconda-plugin](https://github.com/palantir/gradle-miniconda-plugin),
but in addition to creating Conda envs it provides:

1. A convenient DSL to specify target Python environments 
2. Creating Python envs for Unix with [python-build](https://github.com/pyenv/pyenv/tree/master/plugins/python-build) for Unix
<br>N.B.: [Common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems) article from pyenv
3. Creating Python envs for Windows by installing msi or exe from [python.org](https://www.python.org/). 
<br>N.B.: Windows UAC should be switched off, otherwise - use Python from zip
4. Both Anaconda and Miniconda support (32 and 64 bit versions)
5. Creating Conda envrionments, conda package installation support
6. Creating Jython environments
7. Creating PyPy environments (only Unix is supported, by default pypy2.7-5.8.0 version is used)
8. Creating IronPython environments (only Windows is supported, by default [2.7.7 version](https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.7) is used)
9. Virtualenv creation from any python environment created
10. Python from zip creation: downloading archive from specified url, unpacking and preparing to work with
11. Package installation for any environment or virtualenv 


Usage
-----
                                                
Apply the plugin to your project following
[`https://plugins.gradle.org/plugin/com.jetbrains.python.envs`](https://plugins.gradle.org/plugin/com.jetbrains.python.envs),
and configure the associated extension:

```gradle
envs {
  bootstrapDirectory = new File(buildDir, 'bootstrap')
  envsDirectory = new File(buildDir, 'envs')
  
  // Download python zips when Windows is used from http://repository.net/%archieveName%,
  // where {archieveName} is python-{version}-{architecture}.zip
  zipRepository = new URL("http://repository.net/")
  shouldUseZipsFromRepository = Os.isFamily(Os.FAMILY_WINDOWS)
  
  // by default if architecture isn't specified - 64 bit one is used
  // _64Bits = true
  
  //python "envName", "version", [<packages>]
  python "python35_64", "3.5.3", ["django==1.9"]
  //python "envName", "version", "architecture", [<packages>]
  python "python36_32", "3.6.2", "32", ["django==1.10"]
  //virtualenv "virtualEnvName", "sourceEnvName", [<packages>]
  virtualenv "envPython35", "python35_64", ["pytest"]
  virtualenv "envPython36", "python36_32", ["behave", "requests"]

  //conda "envName", "version", "architecture"
  conda "Miniconda3", "Miniconda3-latest", "64"
  //conda "envName", "version", [<packages>]
  conda "Anaconda2", "Anaconda2-4.4.0", [condaPackage("PyQt")]
  //conda "envName", "version", "architecture", [<packages>]
  conda "Anaconda3", "Anaconda3-4.4.0", "64", ["django==1.8"]
  
  //condaenv "envName", "version", [<packages>]
  //Here will be created additional "Miniconda2-latest" (or another one specified in condaDefaultVersion value) 
  //conda interpreter to be bootstraped
  condaenv "pyqt_env", "2.7", [condaPackage("pyqt")]
  //condaenv "envName", "version", "sourceEnvName", [<packages>]
  condaenv "django19", "2.7", "Miniconda3", ["django==1.9"]
  condaenv "conda34", "3.4", "Miniconda3", ["ipython==2.1", "django==1.6", "behave", "jinja2", "tox==2.0"]<commit_msg>modified README.md<commit_after>[![official JetBrains project](http://jb.gg/badges/official-plastic.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)

Gradle Python Envs Plugin
========================

Gradle plugin to create Python envs.

This plugin is based on [gradle-miniconda-plugin](https://github.com/palantir/gradle-miniconda-plugin),
but in addition to creating Conda envs it provides:

1. A convenient DSL to specify target Python environments 
2. Creating Python envs for Unix with [python-build](https://github.com/pyenv/pyenv/tree/master/plugins/python-build) for Unix
<br>N.B.: [Common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems) article from pyenv
3. Creating Python envs for Windows by installing msi or exe from [python.org](https://www.python.org/). 
<br>N.B.: Windows UAC should be switched off, otherwise - use Python from zip
4. Both Anaconda and Miniconda support (32 and 64 bit versions)
5. Creating Conda envrionments, conda package installation support
6. Creating Jython environments
7. Creating PyPy environments (only Unix is supported, by default pypy2.7-5.8.0 version is used)
8. Creating IronPython environments (only Windows is supported, by default [2.7.7 version](https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.7) is used)
9. Virtualenv creation from any python environment created
10. Python from zip creation: downloading archive from specified url, unpacking and preparing to work with
11. Package installation for any environment or virtualenv with specified install options


Usage
-----
                                                
Apply the plugin to your project following
[`https://plugins.gradle.org/plugin/com.jetbrains.python.envs`](https://plugins.gradle.org/plugin/com.jetbrains.python.envs),
and configure the associated extension:

```gradle
envs {
  bootstrapDirectory = new File(buildDir, 'bootstrap')
  envsDirectory = new File(buildDir, 'envs')
  
  // Download python zips when Windows is used from http://repository.net/%archieveName%,
  // where {archieveName} is python-{version}-{architecture}.zip
  zipRepository = new URL("http://repository.net/")
  shouldUseZipsFromRepository = Os.isFamily(Os.FAMILY_WINDOWS)
  
  // by default if architecture isn't specified - 64 bit one is used
  // _64Bits = true
  
  // by default pipInstallOptions equals to "--trusted-host pypi.python.org" 
  // to fix CERTIFICATE_VERIFY_FAILED ssl error
  // pipInstallOptions = "--trusted-host pypi.python.org"
  
  //python "envName", "version", [<packages>]
  python "python35_64", "3.5.3", ["django==1.9"]
  //python "envName", "version", "architecture", [<packages>]
  python "python36_32", "3.6.2", "32", ["django==1.10"]
  //virtualenv "virtualEnvName", "sourceEnvName", [<packages>]
  virtualenv "envPython35", "python35_64", ["pytest"]
  virtualenv "envPython36", "python36_32", ["behave", "requests"]

  //conda "envName", "version", "architecture"
  conda "Miniconda3", "Miniconda3-latest", "64"
  //conda "envName", "version", [<packages>]
  conda "Anaconda2", "Anaconda2-4.4.0", [condaPackage("PyQt")]
  //conda "envName", "version", "architecture", [<packages>]
  conda "Anaconda3", "Anaconda3-4.4.0", "64", ["django==1.8"]
  
  //condaenv "envName", "version", [<packages>]
  // Here will be created additional "Miniconda2-latest" 
  // (or another one specified in condaDefaultVersion value) 
  // conda interpreter to be bootstraped
  condaenv "pyqt_env", "2.7", [condaPackage("pyqt")]
  //condaenv "envName", "version", "sourceEnvName", [<packages>]
  condaenv "django19", "2.7", "Miniconda3", ["django==1.9"]
  condaenv "conda34", "3.4", "Miniconda3", ["ipython==2.1", "django==1.6", "behave", "jinja2", "tox==2.0"]
{'fraction_non_alphanumeric': 0.15099009900990099, 'fraction_numerical': 0.029152915291529153, 'mean_word_length': 4.497354497354498, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 16, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1808766', 'n_tokens_mistral': 2469, 'n_tokens_neox': 2276, 'n_words': 657}