Skip to content

Commit 4c1be52

Browse files
fix: Use packaging.version for proper version comparison
String comparison fails for versions like "2.10" vs "2.2" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1ceabd5 commit 4c1be52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/datajoint/migrate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
import warnings
2525
from typing import TYPE_CHECKING
2626

27+
from packaging.version import Version
28+
2729
from .errors import DataJointError
2830
from . import __version__
2931

3032
# Show deprecation warning starting in 2.1
31-
if __version__ >= "2.1":
33+
if Version(__version__) >= Version("2.1"):
3234
warnings.warn(
3335
"datajoint.migrate is deprecated and will be removed in DataJoint 2.2. "
3436
"Complete your schema migrations before upgrading.",

0 commit comments

Comments
 (0)