File: fix-minor-version-check.patch

package info (click to toggle)
brian 2.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,872 kB
  • sloc: python: 51,820; cpp: 2,033; makefile: 108; sh: 72
file content (26 lines) | stat: -rw-r--r-- 900 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
Description: fix version check.
 This change is a Debian specific workaround needed for adjunction of
 +ds repacking suffix, and probably needs to be removed once the repack
 is not needed anymore, probably on next upstream revisions.

Author: Étienne Mollier <emollier@debian.org>
Forwarded: not-needed
Last-Update: 2024-08-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- brian.orig/brian2/tests/test_base.py
+++ brian/brian2/tests/test_base.py
@@ -1,3 +1,4 @@
+import re
 import pytest
 from numpy.testing import assert_equal
 from packaging.version import parse as parse_version
@@ -98,7 +99,7 @@
     version_tuple = brian2.__version_tuple__
 
     expected = []
-    for v in version.split("."):
+    for v in tuple(int(i) if i.isnumeric() else i for i in re.split(r"\.|\+", version)):
         try:
             expected.append(int(v))
         except ValueError: