Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version numbers in bundle resolver to comply with PEP 440 #1007

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ydkgen/resolver/bundle_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from collections import namedtuple, defaultdict
from .bundle_translator import translate
from ..common import YdkGenException
from packaging.version import Version


logger = logging.getLogger('ydkgen')
Expand All @@ -38,7 +39,6 @@
Remote = namedtuple('Remote', ['url', 'commitid', 'path'])
RepoDir = namedtuple('RepoDir', ['repo', 'dir'])
Bundles = namedtuple('Bundles', ['curr_bundle', 'bundles'])
Version = namedtuple('Version', ['major', 'minor', 'patch'])


def nested_defaultdict():
Expand Down Expand Up @@ -81,8 +81,8 @@ class BundleDefinition(object):

def __init__(self, data):
self._name = data['name'].replace('-', '_')
self._version = Version(*tuple(data['version'].split('.')))
self._core_version = Version(*tuple(data['core-version'].split('.')))
self._version = Version(data['version'])
valeriodigregorio marked this conversation as resolved.
Show resolved Hide resolved
self._core_version = Version(data['core-version'])
valeriodigregorio marked this conversation as resolved.
Show resolved Hide resolved
self._description = data['description'] if 'description' in data else str()
self._long_description = data['long-description'] if 'long-description' in data else str()

Expand All @@ -108,12 +108,12 @@ def core_version(self):
@property
def str_version(self):
""" Return string representation of version."""
return "%s.%s.%s" % self.version
return str(self.version)

@property
def str_core_version(self):
""" Return string representation of ydk version."""
return "%s.%s.%s" % self.core_version
return str(self.core_version)

@property
def description(self):
Expand Down