Skip to content

Commit 094edb8

Browse files
author
Vladimir Kotal
authored
Run pylint in venv (#2443)
fixes #2442
1 parent 055052c commit 094edb8

File tree

3 files changed

+47
-22
lines changed

3 files changed

+47
-22
lines changed

dev/install-python-packages.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
python3 -m pip install --upgrade pip
44

5-
python3 -m pip install -r opengrok-tools/src/main/python/requirements.txt
6-
if [[ $? != 0 ]]; then
7-
echo "cannot install Python requirement packages"
8-
exit 1
9-
fi
10-
11-
python3 -m pip install pep8 flake8 virtualenv pylint
5+
python3 -m pip install pep8 flake8 virtualenv
126
if [[ $? != 0 ]]; then
137
echo "cannot install Python packages"
148
exit 1

opengrok-tools/pom.xml

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,29 +140,30 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
140140
</goals>
141141
</execution>
142142
<execution>
143-
<id>Python lint</id>
143+
<id>generate python env</id>
144144
<configuration>
145-
<executable>pylint</executable>
145+
<executable>python3</executable>
146+
<workingDirectory>${project.build.directory}</workingDirectory>
146147
<arguments>
147-
<argument>-E</argument>
148-
<argument>${project.build.sourceDirectory}/opengrok_tools</argument>
149-
<argument>${project.build.directory}/setup.py</argument>
148+
<argument>-m</argument>
149+
<argument>venv</argument>
150+
<argument>env</argument>
150151
</arguments>
151152
</configuration>
152-
<phase>verify</phase>
153+
<phase>test</phase>
153154
<goals>
154155
<goal>exec</goal>
155156
</goals>
156157
</execution>
157158
<execution>
158-
<id>generate python env</id>
159+
<id>Upgrade pip</id>
159160
<configuration>
160-
<executable>python3</executable>
161-
<workingDirectory>${project.build.directory}</workingDirectory>
161+
<executable>env/bin/pip3</executable>
162+
<workingDirectory>${project.build.directory}</workingDirectory>
162163
<arguments>
163-
<argument>-m</argument>
164-
<argument>venv</argument>
165-
<argument>env</argument>
164+
<argument>install</argument>
165+
<argument>--upgrade</argument>
166+
<argument>pip</argument>
166167
</arguments>
167168
</configuration>
168169
<phase>test</phase>
@@ -201,6 +202,36 @@ Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
201202
<goal>exec</goal>
202203
</goals>
203204
</execution>
205+
<execution>
206+
<id>Install Python lint</id>
207+
<configuration>
208+
<executable>${project.build.directory}/env/bin/pip3</executable>
209+
<arguments>
210+
<argument>install</argument>
211+
<argument>pylint</argument>
212+
</arguments>
213+
</configuration>
214+
<phase>verify</phase>
215+
<goals>
216+
<goal>exec</goal>
217+
</goals>
218+
</execution>
219+
<execution>
220+
<id>Python lint</id>
221+
<configuration>
222+
<executable>env/bin/pylint</executable>
223+
<workingDirectory>${project.build.directory}</workingDirectory>
224+
<arguments>
225+
<argument>-E</argument>
226+
<argument>${project.build.sourceDirectory}/opengrok_tools</argument>
227+
<argument>${project.build.directory}/setup.py</argument>
228+
</arguments>
229+
</configuration>
230+
<phase>verify</phase>
231+
<goals>
232+
<goal>exec</goal>
233+
</goals>
234+
</execution>
204235
<execution>
205236
<id>python-test</id>
206237
<configuration>

opengrok-tools/src/main/python/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jsonschema==2.6.0
66
JsonSir==0.0.2
77
Python-EasyConfig==0.1.7
88
PyYAML==3.13
9-
requests>=2.2.1
9+
requests==2.19.1
1010
Resource==0.2.1
11-
six>=1.5.0
12-
urllib3>=1.7
11+
six==1.11.0
12+
urllib3==1.23

0 commit comments

Comments
 (0)