File: fix-minor-version-check.patch

package info (click to toggle)
brian 2.8.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,872 kB
  • sloc: python: 51,548; cpp: 2,011; makefile: 116; sh: 64
file content (26 lines) | stat: -rw-r--r-- 884 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
 
@@ -95,7 +96,7 @@
 
     # Check that the version tuple is correct
     version_tuple = brian2.__version_tuple__
-    assert version_tuple == tuple(int(i) for i in version.split(".")[:4])
+    assert version_tuple == tuple(int(i) if i.isnumeric() else i for i in re.split(r"\.|\+", version))
 
 
 if __name__ == "__main__":