Skip to content

Commit b3dbbcc

Browse files
authored
Merge pull request #303 from netromdk/issue-279
Improve readability of incompatible version reports
2 parents acff55c + f711f2d commit b3dbbcc

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,18 @@ Examples
210210
211211
% ./vermin.py vermin
212212
Minimum required versions: 3.0
213-
Incompatible versions: 2
213+
Incompatible versions: 2.x
214214
215215
% ./vermin.py -t=3.3 vermin
216216
Minimum required versions: 3.0
217-
Incompatible versions: 2
217+
Incompatible versions: 2.x
218218
Target versions not met: 3.3
219219
% echo $?
220220
1
221221
222222
% ./vermin.py --versions vermin
223223
Minimum required versions: 3.0
224-
Incompatible versions: 2
224+
Incompatible versions: 2.x
225225
Version range: 2.0, 2.6, 2.7, 3.0
226226
227227
% ./vermin.py -v examples
@@ -234,7 +234,7 @@ Examples
234234
!2, 3.4 /path/to/examples/abc.py
235235
/path/to/examples/unknown.py
236236
Minimum required versions: 3.4
237-
Incompatible versions: 2
237+
Incompatible versions: 2.x
238238
239239
% ./vermin.py -vv /path/to/examples/abc.py
240240
Detecting python files..
@@ -244,7 +244,7 @@ Examples
244244
'abc.ABC' requires !2, 3.4
245245
246246
Minimum required versions: 3.4
247-
Incompatible versions: 2
247+
Incompatible versions: 2.x
248248
249249
% ./vermin.py -vvv /path/to/examples/abc.py
250250
Detecting python files..
@@ -254,7 +254,7 @@ Examples
254254
L2: 'abc.ABC' requires !2, 3.4
255255
256256
Minimum required versions: 3.4
257-
Incompatible versions: 2
257+
Incompatible versions: 2.x
258258
259259
% ./vermin.py -f parsable /path/to/examples/abc.py
260260
/path/to/examples/abc.py:1:7:2.6:3.0:'abc' module

vermin/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ def main():
148148
# not to show incompatible versions with -i specified.
149149
if len(incomps) > 0 and (not parsable and (not config.ignore_incomp() or len(reqs) == 0)):
150150
# pragma: no cover
151+
# Improve readability by using, for example, (2, 'x') instead of (2,) such that it reports:
152+
# Incompatible versions: 2.x
153+
# Over:
154+
# Incompatible versions: 2
155+
incomps = [(v, 'x') if isinstance(v, int) else v for v in incomps]
151156
nprint("Incompatible versions: {}".format(version_strings(incomps)), config)
152157

153158
if args["versions"] and len(unique_versions) > 0:

0 commit comments

Comments
 (0)