Skip to content

Commit 27a3a66

Browse files
authored
fix merge error
1 parent afd9b73 commit 27a3a66

File tree

1 file changed

+1
-62
lines changed

1 file changed

+1
-62
lines changed

builder/frameworks/arduino.py

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
http://arduino.cc/en/Reference/HomePage
2323
"""
2424

25-
import subprocess
26-
import json
2725
import os
2826
import sys
2927
import shutil
@@ -34,23 +32,12 @@
3432
from pathlib import Path
3533
from typing import Union, List
3634

37-
import semantic_version
3835
from SCons.Script import DefaultEnvironment, SConscript
3936
from platformio import fs
40-
from platformio.package.version import pepver_to_semver
4137
from platformio.package.manager.tool import ToolPackageManager
4238

4339
IS_WINDOWS = sys.platform.startswith("win")
4440

45-
python_deps = {
46-
"wheel": ">=0.35.1",
47-
"rich-click": ">=1.8.6",
48-
"PyYAML": ">=6.0.2",
49-
"intelhex": ">=2.3.0",
50-
"rich": ">=14.0.0",
51-
"esp-idf-size": ">=1.6.1"
52-
}
53-
5441
# Constants for better performance
5542
UNICORE_FLAGS = {
5643
"CORE32SOLO1",
@@ -601,53 +588,6 @@ def has_unicore_flags():
601588
env.Replace(BUILD_UNFLAGS=new_build_unflags)
602589

603590

604-
def get_packages_to_install(deps, installed_packages):
605-
"""Generator for packages to install"""
606-
for package, spec in deps.items():
607-
if package not in installed_packages:
608-
yield package
609-
else:
610-
version_spec = semantic_version.Spec(spec)
611-
if not version_spec.match(installed_packages[package]):
612-
yield package
613-
614-
615-
def install_python_deps():
616-
def _get_installed_pip_packages():
617-
result = {}
618-
try:
619-
pip_output = subprocess.check_output([
620-
env.subst("$PYTHONEXE"),
621-
"-m", "pip", "list", "--format=json",
622-
"--disable-pip-version-check"
623-
])
624-
packages = json.loads(pip_output)
625-
for p in packages:
626-
result[p["name"]] = pepver_to_semver(p["version"])
627-
except Exception:
628-
print("Warning! Couldn't extract the list of installed Python "
629-
"packages.")
630-
631-
return result
632-
633-
installed_packages = _get_installed_pip_packages()
634-
packages_to_install = list(get_packages_to_install(python_deps,
635-
installed_packages))
636-
637-
if packages_to_install:
638-
packages_str = " ".join(f'"{p}{python_deps[p]}"'
639-
for p in packages_to_install)
640-
env.Execute(
641-
env.VerboseAction(
642-
f'"$PYTHONEXE" -m pip install -U -q -q -q {packages_str}',
643-
"Installing Arduino Python dependencies",
644-
)
645-
)
646-
647-
648-
install_python_deps()
649-
650-
651591
def get_MD5_hash(phrase):
652592
return hashlib.md5(phrase.encode('utf-8')).hexdigest()[:16]
653593

@@ -955,6 +895,7 @@ def get_frameworks_in_current_env():
955895

956896
if ("arduino" in pioframework and "espidf" not in pioframework and
957897
arduino_lib_compile_flag in ("Inactive", "True")):
898+
958899
# try to remove not needed include path if an lib_ignore entry exists
959900
from component_manager import ComponentManager
960901
component_manager = ComponentManager(env)
@@ -965,8 +906,6 @@ def get_frameworks_in_current_env():
965906
env.AddPostAction("checkprogsize", silent_action)
966907

967908
if IS_WINDOWS:
968-
# Smart include path optimization based on bleeding edge configurable
969-
# threshold
970909
env.AddBuildMiddleware(smart_include_length_shorten)
971910

972911
build_script_path = join(FRAMEWORK_DIR, "tools", "pioarduino-build.py")

0 commit comments

Comments
 (0)