Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Oct 5, 2024
1 parent 280a8d2 commit 0b6373c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions unidep/_pixi_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,12 @@ def _pixi_lock_subpackage(
locked_keys: set[tuple[CondaPip, Platform, str]] = set()
missing_keys: set[tuple[CondaPip, Platform, str]] = set()

def add_package_with_dependencies(platform: Platform, name: str) -> None:
key: tuple[CondaPip, Platform, str] = ("conda", platform, name)
def add_package_with_dependencies(
which: CondaPip,
platform: Platform,
name: str,
) -> None:
key: tuple[CondaPip, Platform, str] = (which, platform, name)
if key in locked_keys:
return
if key not in lock_spec.packages:
Expand All @@ -243,7 +247,7 @@ def add_package_with_dependencies(platform: Platform, name: str) -> None:
# Recursively add dependencies
dependencies = lock_spec.dependencies.get(key, set())
for dep_name in dependencies:
add_package_with_dependencies(platform, dep_name)
add_package_with_dependencies(which, platform, dep_name)

for name, specs in requirements.requirements.items():
if name.startswith("__"):
Expand All @@ -256,7 +260,7 @@ def add_package_with_dependencies(platform: Platform, name: str) -> None:
_platforms = [p for p in _platforms if p in platforms]

for _platform in _platforms:
add_package_with_dependencies(_platform, name)
add_package_with_dependencies(spec.which, _platform, name)

if missing_keys:
print(f"⚠️ Missing packages: {missing_keys}")
Expand Down

0 comments on commit 0b6373c

Please sign in to comment.