Skip to content

Commit f3f83d3

Browse files
committed
Fixed bug in smart-install resolution for non-specified versions.
1 parent 1c24282 commit f3f83d3

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

omnipkg/core.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5848,6 +5848,25 @@ def smart_install(self, packages: List[str], dry_run: bool = False, force_reinst
58485848
if original_strategy != override_strategy:
58495849
safe_print(f' - 🔄 Using override strategy: {override_strategy}')
58505850
self.config['install_strategy'] = override_strategy
5851+
5852+
# ✅ MOVE THIS LINE HERE - Define install_strategy EARLY
5853+
install_strategy = self.config.get('install_strategy', 'stable-main')
5854+
5855+
if not self._connect_cache():
5856+
return 1
5857+
self._heal_conda_environment()
5858+
5859+
# ====================================================================
5860+
# NORMAL INITIALIZATION (Only runs if packages need work)
5861+
# ====================================================================
5862+
original_strategy = None
5863+
if override_strategy:
5864+
original_strategy = self.config.get('install_strategy', 'stable-main')
5865+
if original_strategy != override_strategy:
5866+
safe_print(f' - 🔄 Using override strategy: {override_strategy}')
5867+
self.config['install_strategy'] = override_strategy
5868+
install_strategy = self.config.get('install_strategy', 'stable-main')
5869+
58515870
if not self._connect_cache():
58525871
return 1
58535872
self._heal_conda_environment()
@@ -6025,10 +6044,14 @@ def smart_install(self, packages: List[str], dry_run: bool = False, force_reinst
60256044
new_omnipkg_instance = self.__class__(new_config_manager)
60266045

60276046
return new_omnipkg_instance.smart_install(packages, dry_run, force_reinstall, target_directory)
6047+
#
6048+
# Instead, just log and continue:
60286049
if not all_packages_satisfied:
6029-
safe_print(_('❌ Could not resolve all packages. Aborting installation.'))
6030-
return 1
6050+
preflight_time = (time.perf_counter() - preflight_start) * 1000
6051+
6052+
# Continue to main installation logic below...
60316053

6054+
# Phase 3: KB check only for complex cases (nested packages, complex strategies)
60326055
# Phase 3: KB check only for complex cases (nested packages, complex strategies)
60336056
if needs_kb_check and all_packages_satisfied:
60346057
safe_print(f'🔍 Checking {len(needs_kb_check)} package(s) requiring deeper verification...')
@@ -6052,18 +6075,17 @@ def smart_install(self, packages: List[str], dry_run: bool = False, force_reinst
60526075
if not nested_found:
60536076
# If we get here, package is truly not satisfied anywhere
60546077
kb_satisfied = False
6055-
break
6078+
break # ✅ ADD THIS BREAK
60566079
else:
60576080
safe_print(f'✅ {pkg_spec} already satisfied (nested)')
60586081
processed_packages.append(pkg_spec)
60596082

60606083
all_packages_satisfied = kb_satisfied
60616084

6062-
preflight_time = (time.perf_counter() - preflight_start) * 1000
6063-
6064-
# Early exit if everything is satisfied
6065-
6066-
safe_print(f'📦 Preflight detected packages need installation ({preflight_time:.1f}ms)')
6085+
# ✅ ADD THIS CHECK AFTER PHASE 3
6086+
if not all_packages_satisfied:
6087+
safe_print(f'📦 Preflight detected packages need installation ({preflight_time:.1f}ms)')
6088+
# Continue to main installation...
60676089

60686090
# --- MAIN INSTALLATION LOGIC STARTS HERE ---
60696091
# Continue with the rest of your installation logic...

0 commit comments

Comments
 (0)