diff --git a/src/python/jw/pkg/lib/version/Dependency.py b/src/python/jw/pkg/lib/version/Dependency.py index 3b85413c..b9fb9f49 100644 --- a/src/python/jw/pkg/lib/version/Dependency.py +++ b/src/python/jw/pkg/lib/version/Dependency.py @@ -147,9 +147,9 @@ class Dependency: # export ) -> str: """Render the dependency as a version constraint string. - NAMES_ONLY renders the name alone. untemplated keeps the - VERSION, VERSION-REVISION and REVISION macros as written instead - of the resolved versions. include_revision = False drops the + NAMES_ONLY renders the name alone. With untemplated = False the + VERSION, VERSION-REVISION and REVISION macros are kept as + written instead of resolved. include_revision = False drops the revision of VERSION specs. as_range expands a boundary that pins a full version into the range it spans. no_subpackages renders the base name, quote wraps the result in the given @@ -161,12 +161,12 @@ class Dependency: # export if syntax is Syntax.NAMES_ONLY: return name ret: list[str] = [] - for boundary in self.version_boundaries(expanded = as_range, ): + for boundary in self.version_boundaries(expanded = as_range): op = boundary.format_op(syntax) version = boundary.version.id(untemplated, include_revision) ret.append(f'{name} {op} {version}') if ret: - return ' '.join(ret) + return ', '.join(ret) return name return __str() if quote is None else f'{quote}{__str()}{quote}' diff --git a/test/unit/python/jw/pkg/lib/version/test.py b/test/unit/python/jw/pkg/lib/version/test.py index 5f03f9de..2c87c198 100644 --- a/test/unit/python/jw/pkg/lib/version/test.py +++ b/test/unit/python/jw/pkg/lib/version/test.py @@ -122,15 +122,15 @@ constraint = d.constraint_str(untemplated = False, as_range = True) assert constraint == 'foo = VERSION-REVISION' # A full version stays exact; a non-full one expands d = Dependency('foo = VERSION', app.get_version) -assert d.constraint_str(as_range = True) == 'foo >= 1.2.3 foo < 1.2.4' +assert d.constraint_str(as_range = True) == 'foo >= 1.2.3, foo < 1.2.4' d = Dependency('foo >= VERSION', app.get_version) -assert d.constraint_str(as_range = True) == 'foo >= 1.2.3 foo < 1.2.4' +assert d.constraint_str(as_range = True) == 'foo >= 1.2.3, foo < 1.2.4' # '<' and '<=' are not expanded d = Dependency('foo <= VERSION', app.get_version) assert d.constraint_str(as_range = True) == 'foo <= 1.2.3' # The bound steps a micro, so a tripartite core expands d = Dependency('foo = 1.2.3', app.get_version) -assert d.constraint_str(as_range = True) == 'foo >= 1.2.3 foo < 1.2.4' +assert d.constraint_str(as_range = True) == 'foo >= 1.2.3, foo < 1.2.4' # Default syntax is SEM_VER d = Dependency('foo < 2.0') assert d.constraint_str(untemplated = False) == 'foo < 2.0'