File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
main/groovy/ru/vyarus/gradle/plugin/python/cmd
test/groovy/ru/vyarus/gradle/plugin/python/cmd Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 1+ ### 1.0.1 (2018-04-18)
12* Fix pip 10 compatibility (#1 )
23
34### 1.0.1 (2017-12-26)
Original file line number Diff line number Diff 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}
5353apply plugin: 'ru.vyarus.use-python'
5757
5858``` groovy
5959plugins {
60- id 'ru.vyarus.use-python' version '1.0.1 '
60+ id 'ru.vyarus.use-python' version '1.0.2 '
6161}
6262```
6363
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments