Skip to content

Commit fcd3c6d

Browse files
authored
Install piohome with core
* remove telemetry * no full git clone * remove advertisings * add intelhex as required * no core packages * install scons from github * add `argcomplete` as pip dependencies * scons-local-4.8.1 * install piohome with core
1 parent fef5e44 commit fcd3c6d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

platformio/dependencies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
def get_core_dependencies():
1919
return {
2020
"tool-scons",
21+
"contrib-piohome",
2122
}
2223

2324

platformio/package/manager/core.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,31 @@ def get_core_package_dir(name, spec=None, auto_install=True):
6565
"Please add \"check_tool = cppcheck\" to use code check tool.\n"
6666
"In all cases please restart VSC/PlatformIO to try to auto fix issues."
6767
)
68+
69+
if name in ("contrib-piohome") and not os.path.exists(join(base_pack_dir, "contrib-piohome")):
70+
url = (
71+
"https://github.com/pioarduino/registry/releases/"
72+
"download/0.0.1/contrib-piohome-3.4.4.tar.gz"
73+
)
74+
target_path = join(base_pack_dir, "contrib-piohome.tar.gz")
75+
extract_folder = join(base_pack_dir, "contrib-piohome")
76+
with request.urlopen(request.Request(url), timeout=15.0) as response:
77+
if response.status == 200:
78+
with open(target_path, "wb") as f:
79+
f.write(response.read())
80+
with tarfile.open(target_path) as tar:
81+
tar.extractall(extract_folder)
82+
83+
try:
84+
if "contrib-piohome" in name:
85+
pkg_dir = pm.get_package("contrib-piohome").path
86+
assert pm.install("contrib-piohome")
87+
except Exception: # pylint: disable=broad-except
88+
print(
89+
"Maybe missing entry(s) in platformio.ini ?\n"
90+
"Please add \"check_tool = cppcheck\" to use code check tool.\n"
91+
"In all cases please restart VSC/PlatformIO to try to auto fix issues."
92+
)
6893
return pkg_dir
6994

7095

0 commit comments

Comments
 (0)