@@ -52,7 +52,7 @@ buildscript {
52
52
mavenCentral()
53
53
}
54
54
dependencies {
55
- classpath 'ru.vyarus:gradle-use-python-plugin:2.2 .0'
55
+ classpath 'ru.vyarus:gradle-use-python-plugin:2.3 .0'
56
56
}
57
57
}
58
58
apply plugin: 'ru.vyarus.use-python'
62
62
63
63
``` groovy
64
64
plugins {
65
- id 'ru.vyarus.use-python' version '2.2 .0'
65
+ id 'ru.vyarus.use-python' version '2.3 .0'
66
66
}
67
67
```
68
68
@@ -72,7 +72,7 @@ Plugin compiled for java 8, compatible with java 11
72
72
73
73
Gradle | Version
74
74
--------|-------
75
- 5-6 | 2.2 .0
75
+ 5-6 | 2.3 .0
76
76
4.x | [ 1.2.0] ( https://github.com/xvik/gradle-use-python-plugin/tree/1.2.0 )
77
77
78
78
#### Snapshots
@@ -153,6 +153,13 @@ pip3 --version
153
153
choco install python
154
154
```
155
155
156
+ In Windows 10 python 3.9 could be installed from Windows Store:
157
+ just type 'python' in console and windows will open Windows Store's python page.
158
+ No additional actions required after installation.
159
+
160
+ Note that windows store python will require minium virtualenv 20.0.11 (or above).
161
+ (if virtualenv not yet installed then no worry - plugin will install the correct version)
162
+
156
163
##### Linux/Macos install
157
164
158
165
On most * nix distributions python is already installed, but often without pip.
@@ -172,7 +179,7 @@ pip3 install -U pip
172
179
To install exact pip version:
173
180
174
181
``` bash
175
- pip3 install -U pip==10 .0.0
182
+ pip3 install -U pip==20 .0.11
176
183
```
177
184
178
185
Note that on ubuntu pip installed with ` python3-pip ` package is 9.0.1, but it did not(!) downgrade
@@ -229,10 +236,9 @@ To make plugin work on [travis](https://travis-ci.org/) you'll need to install p
229
236
230
237
``` yaml
231
238
language : java
232
- dist : xenial
239
+ dist : bionic
233
240
jdk : openjdk8
234
241
235
- sudo : required
236
242
addons :
237
243
apt :
238
244
packages :
@@ -244,9 +250,7 @@ before_install:
244
250
- sudo pip3 install -U pip
245
251
` ` `
246
252
247
- It will be python 3.5 by default.
248
-
249
- NOTE: travis does not require manual ` sudo` support enable anymore (enabled by default)
253
+ It will be python 3.6 by default (for bionic).
250
254
251
255
#### Appveyour CI configuration
252
256
@@ -256,13 +260,21 @@ To make plugin work on [appveyour](https://www.appveyor.com/) you'll need to add
256
260
environment :
257
261
matrix :
258
262
- JAVA_HOME : C:\Program Files\Java\jdk1.8.0
259
- PYTHON: "C:\\ Python35 -x64"
263
+ PYTHON : " C:\\ Python36 -x64"
260
264
261
265
install :
262
266
- set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
263
267
` ` `
264
268
265
- Now plugin would be able to find python binary.
269
+ Now plugin would be able to find python binary.
270
+
271
+ To use python 3.9 you'll need to switch image:
272
+
273
+ ` ` ` yaml
274
+ image : Visual Studio 2019
275
+ ` ` `
276
+
277
+ See [available pythons matrix](https://www.appveyor.com/docs/windows-images-software/#python) for more info.
266
278
267
279
### Usage
268
280
@@ -756,7 +768,10 @@ python {
756
768
installVirtualenv = true
757
769
// if virtualenv not installed (in --user scope), plugin will install exactly this version
758
770
// (known to be working version) to avoid side effects
759
- virtualenvVersion = '16.7.9'
771
+ virtualenvVersion = '20.4.2'
772
+ // minimal required virtualenv (v20 is recommended, but by default 16 set to not fail previous
773
+ // setups)
774
+ minVirtualenvVersion = '16'
760
775
// used virtualenv path (if virtualenv used, see 'scope')
761
776
envPath = '.gradle/python'
762
777
// copy virtualenv instead of symlink (when created)
@@ -838,7 +853,7 @@ In your plugin, add plugin as dependency:
838
853
839
854
``` groovy
840
855
dependencies {
841
- implementation 'ru.vyarus:gradle-use-python-plugin:2.2 .0'
856
+ implementation 'ru.vyarus:gradle-use-python-plugin:2.3 .0'
842
857
}
843
858
```
844
859
@@ -972,6 +987,39 @@ python.pip 'sommodule:0.9'
972
987
NOTE: all pip declarations are supported so direct module version could be overridden with VCS declaration
973
988
and vice-versa (only the declaration order is important).
974
989
990
+ #### Hide sensitive data in logged command
991
+
992
+ By default, plugin always logs executed python commands, but sometimes such commands could
993
+ contain sensitive data (like passwords).
994
+
995
+ For example, pip's --extra-index-url may contain password:
996
+
997
+ ```
998
+ --extra-index-url http://user:[email protected]
999
+ ```
1000
+
1001
+ In logged command password should be replaced with ***** .
1002
+
1003
+ To deal with such cases, Python object supports registration of ` LoggedCommandCleaner ` object:
1004
+
1005
+ ``` java
1006
+ python. logCommandCleaner(new CleanerInstance)
1007
+ ```
1008
+
1009
+ As an example see Pip object, which register special cleaner for extra index passwords right in its constructor:
1010
+
1011
+ ```java
1012
+ Pip(Python python, boolean userScope, boolean useCache) {
1013
+ ...
1014
+
1015
+ // do not show passwords when external indexes used with credentials
1016
+ python. logCommandCleaner { CliUtils . hidePipCredentials(it) }
1017
+ }
1018
+ ```
1019
+
1020
+ See `CliUtils . hidePipCredentials` for an implementation example (using regexps).
1021
+ Most likely, implementation would be the same in your case .
1022
+
975
1023
### Might also like
976
1024
977
1025
* [quality- plugin](https: // github.com/xvik/gradle-quality-plugin) - java and groovy source quality checks
0 commit comments