Skip to content

Commit 155ea16

Browse files
committed
update docs
1 parent a1c8ef9 commit 155ea16

File tree

2 files changed

+62
-13
lines changed

2 files changed

+62
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
### 2.3.0 (2021-03-01)
12
* Support python installation from Windows Store (#14)
23
* Changed virtualenv version installed by default from 16.7.9 to 20.4.2
34
(because only recent versions could work correctly with python installed from Windows Store)

README.md

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ buildscript {
5252
mavenCentral()
5353
}
5454
dependencies {
55-
classpath 'ru.vyarus:gradle-use-python-plugin:2.2.0'
55+
classpath 'ru.vyarus:gradle-use-python-plugin:2.3.0'
5656
}
5757
}
5858
apply plugin: 'ru.vyarus.use-python'
@@ -62,7 +62,7 @@ OR
6262

6363
```groovy
6464
plugins {
65-
id 'ru.vyarus.use-python' version '2.2.0'
65+
id 'ru.vyarus.use-python' version '2.3.0'
6666
}
6767
```
6868

@@ -72,7 +72,7 @@ Plugin compiled for java 8, compatible with java 11
7272

7373
Gradle | Version
7474
--------|-------
75-
5-6 | 2.2.0
75+
5-6 | 2.3.0
7676
4.x | [1.2.0](https://github.com/xvik/gradle-use-python-plugin/tree/1.2.0)
7777

7878
#### Snapshots
@@ -153,6 +153,13 @@ pip3 --version
153153
choco install python
154154
```
155155

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+
156163
##### Linux/Macos install
157164

158165
On most *nix distributions python is already installed, but often without pip.
@@ -172,7 +179,7 @@ pip3 install -U pip
172179
To install exact pip version:
173180

174181
```bash
175-
pip3 install -U pip==10.0.0
182+
pip3 install -U pip==20.0.11
176183
```
177184

178185
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
229236

230237
```yaml
231238
language: java
232-
dist: xenial
239+
dist: bionic
233240
jdk: openjdk8
234241

235-
sudo: required
236242
addons:
237243
apt:
238244
packages:
@@ -244,9 +250,7 @@ before_install:
244250
- sudo pip3 install -U pip
245251
```
246252
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).
250254
251255
#### Appveyour CI configuration
252256
@@ -256,13 +260,21 @@ To make plugin work on [appveyour](https://www.appveyor.com/) you'll need to add
256260
environment:
257261
matrix:
258262
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
259-
PYTHON: "C:\\Python35-x64"
263+
PYTHON: "C:\\Python36-x64"
260264

261265
install:
262266
- set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
263267
```
264268
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.
266278
267279
### Usage
268280
@@ -756,7 +768,10 @@ python {
756768
installVirtualenv = true
757769
// if virtualenv not installed (in --user scope), plugin will install exactly this version
758770
// (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'
760775
// used virtualenv path (if virtualenv used, see 'scope')
761776
envPath = '.gradle/python'
762777
// copy virtualenv instead of symlink (when created)
@@ -838,7 +853,7 @@ In your plugin, add plugin as dependency:
838853

839854
```groovy
840855
dependencies {
841-
implementation 'ru.vyarus:gradle-use-python-plugin:2.2.0'
856+
implementation 'ru.vyarus:gradle-use-python-plugin:2.3.0'
842857
}
843858
```
844859

@@ -972,6 +987,39 @@ python.pip 'sommodule:0.9'
972987
NOTE: all pip declarations are supported so direct module version could be overridden with VCS declaration
973988
and vice-versa (only the declaration order is important).
974989

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+
9751023
### Might also like
9761024

9771025
* [quality-plugin](https://github.com/xvik/gradle-quality-plugin) - java and groovy source quality checks

0 commit comments

Comments
 (0)