Skip to content

Commit 5cbc402

Browse files
committed
Replace remaining direct setup_python_environment call with platform.setup_python_env
1 parent 7c18afd commit 5cbc402

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

platform.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646

4747
# Import penv_setup functionality
4848
try:
49-
from .builder.penv_setup import setup_python_environment, setup_penv_minimal, get_executable_path
49+
from .builder.penv_setup import setup_penv_simple, get_executable_path
5050
except ImportError:
5151
# Fallback for standalone execution
5252
sys.path.insert(0, str(Path(__file__).parent / "builder"))
53-
from penv_setup import setup_python_environment, setup_penv_minimal, get_executable_path
53+
from penv_setup import setup_penv_simple, get_executable_path
5454

5555

5656
# Constants
@@ -740,14 +740,9 @@ def setup_python_env(self, env):
740740

741741
# This should not happen, but provide fallback
742742
logger.warning("Penv not set up in configure_default_packages, setting up now")
743-
config = ProjectConfig.get_instance()
744-
core_dir = config.get("platformio", "core_dir")
745743

746-
python_exe, esptool_binary_path = setup_python_environment(env, self, core_dir)
747-
self._penv_python = python_exe
748-
self._esptool_path = esptool_binary_path
749-
750-
return python_exe, esptool_binary_path
744+
# Use the centralized setup method
745+
return self.setup_python_env(env)
751746

752747
def configure_default_packages(self, variables: Dict, targets: List[str]) -> Any:
753748
"""Main configuration method with optimized package management."""
@@ -768,8 +763,8 @@ def configure_default_packages(self, variables: Dict, targets: List[str]) -> Any
768763
config = ProjectConfig.get_instance()
769764
core_dir = config.get("platformio", "core_dir")
770765

771-
# Setup penv using minimal function (no SCons dependencies, esptool from tl-install)
772-
penv_python, esptool_path = setup_penv_minimal(self, core_dir, install_esptool=True)
766+
# Setup penv using simple function (no SCons dependencies, esptool from tl-install)
767+
penv_python, esptool_path = setup_penv_simple(self, core_dir)
773768

774769
# Store both for later use
775770
self._penv_python = penv_python

0 commit comments

Comments
 (0)