Skip to content

Commit

Permalink
Stop using parse_version directly
Browse files Browse the repository at this point in the history
since in newer setuptools it doesn't support version
string with `~` anymore

(cherry picked from commit e64c2cb)
  • Loading branch information
fruch committed Nov 30, 2023
1 parent bf5cd06 commit b2de444
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ccmlib/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import shutil
import threading
import time
from pkg_resources import parse_version
from collections import OrderedDict, defaultdict
from concurrent.futures import ThreadPoolExecutor

Expand All @@ -16,6 +15,7 @@
from ccmlib import common, repository
from ccmlib.node import Node, NodeError
from ccmlib.common import logger
from ccmlib.utils.version import parse_version


class Cluster(object):
Expand Down
3 changes: 1 addition & 2 deletions ccmlib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import warnings
from datetime import datetime
import locale
from pkg_resources import parse_version

import yaml
from six import iteritems, print_, string_types
Expand All @@ -24,7 +23,7 @@
from ccmlib import common
from ccmlib.cli_session import CliSession
from ccmlib.repository import setup

from ccmlib.utils.version import parse_version

class Status():
UNINITIALIZED = "UNINITIALIZED"
Expand Down
3 changes: 1 addition & 2 deletions ccmlib/scylla_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import threading
from pathlib import Path

from pkg_resources import parse_version

import psutil
import yaml
import glob
Expand All @@ -30,6 +28,7 @@
from ccmlib.node import NodeError
from ccmlib.node import TimeoutError
from ccmlib.scylla_repository import setup, CORE_PACKAGE_DIR_NAME, SCYLLA_VERSION_FILE
from ccmlib.utils.version import parse_version


class ScyllaNode(Node):
Expand Down
1 change: 1 addition & 0 deletions ccmlib/scylla_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
ArgumentError, CCMError, get_default_path, rmdirs, validate_install_dir, get_scylla_version, aws_bucket_ls,
DOWNLOAD_IN_PROGRESS_FILE, wait_for_parallel_download_finish)
from ccmlib.utils.download import download_file, download_version_from_s3
from ccmlib.utils.version import parse_version

GIT_REPO = "http://github.com/scylladb/scylla.git"

Expand Down
6 changes: 6 additions & 0 deletions ccmlib/utils/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from packaging.version import parse, Version


def parse_version(v: str) -> Version:
v = v.replace('~', '-')
return parse(v)

0 comments on commit b2de444

Please sign in to comment.