We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ab15fc commit c0522feCopy full SHA for c0522fe
nbstata/_version_helper.py
@@ -0,0 +1,16 @@
1
+"""
2
+Version helpers that avoid distutils and runtime pkg_resources.
3
4
+from __future__ import annotations
5
+from packaging.version import Version, InvalidVersion
6
+
7
+def version_at_least(v: str, minimum: str) -> bool:
8
+ """
9
+ Return True if version string v >= minimum using robust PEP 440 parsing.
10
+ Replaces pkg_resources.parse_version / distutils.LooseVersion.
11
12
+ try:
13
+ return Version(v) >= Version(minimum)
14
+ except InvalidVersion:
15
+ # Conservative fallback: treat unknown as not meeting the minimum
16
+ return False
0 commit comments