Skip to content

Commit 15e1364

Browse files
committed
update docs
1 parent e6c4885 commit 15e1364

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
### 1.0.1 (2018-04-18)
12
* Fix pip 10 compatibility (#1)
23

34
### 1.0.1 (2017-12-26)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ buildscript {
4747
jcenter()
4848
}
4949
dependencies {
50-
classpath 'ru.vyarus:gradle-use-python-plugin:1.0.1'
50+
classpath 'ru.vyarus:gradle-use-python-plugin:1.0.2'
5151
}
5252
}
5353
apply plugin: 'ru.vyarus.use-python'
@@ -57,7 +57,7 @@ OR
5757

5858
```groovy
5959
plugins {
60-
id 'ru.vyarus.use-python' version '1.0.1'
60+
id 'ru.vyarus.use-python' version '1.0.2'
6161
}
6262
```
6363

src/main/groovy/ru/vyarus/gradle/plugin/python/cmd/Pip.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ class Pip {
115115
Matcher matcher = VERSION.matcher(versionLine)
116116
if (matcher.find()) {
117117
// note: this will drop beta postfix (e.g. for 10.0.0b2 version will be 10.0.0)
118-
String ver = matcher.group(1)
119-
if (ver) {
120-
return ver
121-
}
118+
return matcher.group(1)
122119
}
123120
// if can't recognize version, ask directly
124121
return python.withHiddenLog {

src/test/groovy/ru/vyarus/gradle/plugin/python/cmd/PipCliTest.groovy

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,31 @@ class PipCliTest extends AbstractTest {
4545

4646
def "Check version parse fail"() {
4747

48-
when: "prepare pip"
48+
when: "fallback to python call"
4949
Project project = project()
50-
Pip pip = new FooPip(project)
50+
Pip pip = new FooPip(project, 'you will not parse it')
51+
then: "ok"
52+
pip.version =~ /\d+\.\d+\.\d+/
53+
54+
when: "empty version in regex fallback to python"
55+
pip = new FooPip(project, 'pip form ')
5156
then: "ok"
5257
pip.version =~ /\d+\.\d+\.\d+/
5358

5459
}
5560

5661
class FooPip extends Pip {
5762

58-
FooPip(Project project) {
63+
String line
64+
65+
FooPip(Project project, String line) {
5966
super(project)
67+
this.line = line
6068
}
6169

6270
@Override
6371
String getVersionLine() {
64-
return 'you will not parse it'
72+
return line
6573
}
6674
}
6775
}

0 commit comments

Comments
 (0)