Skip to content

Commit

Permalink
Use verlib2.Version instead of crate.client._pep440.Version
Browse files Browse the repository at this point in the history
Instead of vendoring `Version` from `packaging`, pull it in via shared
library.
  • Loading branch information
amotl committed Jan 17, 2024
1 parent 4933513 commit 082af37
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion crate/crash/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
from urllib3.exceptions import LocationParseError

from crate.client import connect
from crate.client._pep440 import Version
from crate.client.exceptions import ConnectionError, ProgrammingError

from verlib2 import Version

from ..crash import __version__ as crash_version
from .commands import Command, built_in_commands
from .config import Configuration, ConfigurationError
Expand Down
2 changes: 1 addition & 1 deletion crate/crash/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import os
from collections import OrderedDict

from crate.client._pep440 import Version
from verlib2 import Version


class Command(object):
Expand Down
2 changes: 1 addition & 1 deletion crate/crash/sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from collections import namedtuple

from crate.client._pep440 import Version
from verlib2 import Version

Result = namedtuple('Result', ['rows', 'cols'])
SYSINFO_MIN_VERSION = Version("0.54.0")
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
'platformdirs<5',
'prompt-toolkit>=3.0,<4',
'tabulate>=0.9,<0.10',
'sqlparse>=0.4.4,<0.5.0'
'sqlparse>=0.4.4,<0.5.0',
'verlib2<0.3',
]


Expand Down
3 changes: 2 additions & 1 deletion tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

from unittest import TestCase

from crate.client._pep440 import Version
from verlib2 import Version

from crate.crash.command import (
Result,
get_information_schema_query,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
from unittest import SkipTest, TestCase
from unittest.mock import MagicMock, call, patch

from crate.client._pep440 import Version
from verlib2 import Version

from crate.crash.command import CrateShell
from crate.crash.commands import (
CheckCommand,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
from unittest import TestCase
from unittest.mock import PropertyMock, patch

from crate.client._pep440 import Version
from verlib2 import Version

from crate.crash.command import CrateShell
from crate.crash.sysinfo import Result as Res, SysInfoCommand

Expand Down

0 comments on commit 082af37

Please sign in to comment.