File: 0005-use_looseversion.patch

package info (click to toggle)
python-pint 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,068 kB
  • sloc: python: 9,481; makefile: 138
file content (42 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From a3679a536a318454dcf363eb22c7fe8d7a803890 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= <ondrej.novy@firma.seznam.cz>
Date: Mon, 11 Jul 2016 07:39:30 +0200
Subject: use_looseversion

commit 1dc2f5b5b131c1bf6c0e89fa28ba8a785a5865d3

    Use LooseVersion for NumPy version comparing

    Because NumPy is releasing version likes 1.11.1rc1, which is not
    StrictVersion
---
 pint/testsuite/helpers.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/pint/testsuite/helpers.py
+++ b/pint/testsuite/helpers.py
@@ -4,7 +4,7 @@
 
 
 import doctest
-from distutils.version import StrictVersion
+from distutils.version import LooseVersion
 import re
 import unittest
 
@@ -14,13 +14,13 @@
 def requires_numpy18():
     if not HAS_NUMPY:
         return unittest.skip('Requires NumPy')
-    return unittest.skipUnless(StrictVersion(NUMPY_VER) >= StrictVersion('1.8'), 'Requires NumPy >= 1.8')
+    return unittest.skipUnless(LooseVersion(NUMPY_VER) >= LooseVersion('1.8'), 'Requires NumPy >= 1.8')
 
 
 def requires_numpy_previous_than(version):
     if not HAS_NUMPY:
         return unittest.skip('Requires NumPy')
-    return unittest.skipUnless(StrictVersion(NUMPY_VER) < StrictVersion(version), 'Requires NumPy < %s' % version)
+    return unittest.skipUnless(LooseVersion(NUMPY_VER) < LooseVersion(version), 'Requires NumPy < %s' % version)
 
 
 def requires_numpy():