Skip to content

Commit

Permalink
Fix Bug and Retry
Browse files Browse the repository at this point in the history
  • Loading branch information
srilman committed Jan 22, 2023
1 parent a438337 commit 12bc805
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion conda_lock/src_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,16 @@ def merge_dependencies(
dep_b, VersionedDependency
):
if dep_a.manager == "pip":
if not dep_a.version:
vstr = dep_b.version
elif not dep_b.version:
vstr = dep_a.version
else:
vstr = f"{dep_a.version},{dep_b.version}"

return VersionedDependency(
name=dep_a.name,
version=f"{dep_a.version},{dep_b.version}",
version=vstr,
manager="pip",
optional=dep_a.optional,
category=dep_a.category,
Expand Down
4 changes: 4 additions & 0 deletions conda_lock/src_parser/conda_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def conda_spec_to_versioned_dep(spec: str, category: str) -> SourceDependency:

def merge_version_specs(ver_a: str, ver_b: str) -> str:
"""Merge / And 2 Conda VersionSpec Strings Together"""
if not ver_a:
return ver_b
if not ver_b:
return ver_a
if ver_a == ver_b:
return ver_a

Expand Down

0 comments on commit 12bc805

Please sign in to comment.