Skip to content

Commit 3ea3c56

Browse files
authored
Refactor dependency version checking logic
Removed regex for PLATFORMIO URL version matching and related logic.
1 parent 6896c27 commit 3ea3c56

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

builder/penv_setup.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import json
1616
import os
17-
import re
1817
import semantic_version
1918
import shutil
2019
import site
@@ -43,11 +42,6 @@
4342

4443
github_actions = bool(os.getenv("GITHUB_ACTIONS"))
4544

46-
PLATFORMIO_URL_VERSION_RE = re.compile(
47-
r'/v?(\d+\.\d+\.\d+(?:[.-](?:alpha|beta|rc|dev|post|pre)\d*)?(?:\.\d+)?)(?:\.(?:zip|tar\.gz|tar\.bz2))?$',
48-
re.IGNORECASE,
49-
)
50-
5145
# Python dependencies required for ESP32 platform builds
5246
python_deps = {
5347
"pioarduino": ">=6.1.19",
@@ -347,17 +341,6 @@ def get_packages_to_install(deps, installed_packages):
347341
name = package.lower()
348342
if name not in installed_packages:
349343
yield package
350-
elif name == "platformio":
351-
# Enforce the version from the direct URL if it looks like one.
352-
# If version can't be parsed, fall back to accepting any installed version.
353-
m = PLATFORMIO_URL_VERSION_RE.search(spec)
354-
if m:
355-
expected_ver = pepver_to_semver(m.group(1))
356-
if installed_packages.get(name) != expected_ver:
357-
# Reinstall to align with the pinned URL version
358-
yield package
359-
else:
360-
continue
361344
else:
362345
version_spec = semantic_version.SimpleSpec(spec)
363346
if not version_spec.match(installed_packages[name]):

0 commit comments

Comments
 (0)