|
49 | 49 | # Python dependencies required for the build process
|
50 | 50 | python_deps = {
|
51 | 51 | "uv": ">=0.1.0",
|
52 |
| - "platformio": ">=6.1.18", |
| 52 | + "platformio": "https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip", |
53 | 53 | "pyyaml": ">=6.0.2",
|
54 | 54 | "rich-click": ">=1.8.6",
|
55 | 55 | "zopfli": ">=0.2.2",
|
@@ -150,6 +150,17 @@ def get_packages_to_install(deps, installed_packages):
|
150 | 150 | for package, spec in deps.items():
|
151 | 151 | if package not in installed_packages:
|
152 | 152 | yield package
|
| 153 | + elif package == "platformio": |
| 154 | + # Enforce the version from the direct URL if it looks like one. |
| 155 | + # If version can't be parsed, fall back to accepting any installed version. |
| 156 | + m = re.search(r'/v?(\d+\.\d+\.\d+(?:\.\d+)?)(?:\.(?:zip|tar\.gz|tar\.bz2))?$', spec) |
| 157 | + if m: |
| 158 | + expected_ver = semantic_version.Version(m.group(1)) |
| 159 | + if installed_packages.get(package) != expected_ver: |
| 160 | + # Reinstall to align with the pinned URL version |
| 161 | + yield package |
| 162 | + else: |
| 163 | + continue |
153 | 164 | else:
|
154 | 165 | version_spec = semantic_version.Spec(spec)
|
155 | 166 | if not version_spec.match(installed_packages[package]):
|
@@ -242,7 +253,13 @@ def _get_installed_uv_packages():
|
242 | 253 | packages_to_install = list(get_packages_to_install(python_deps, installed_packages))
|
243 | 254 |
|
244 | 255 | if packages_to_install:
|
245 |
| - packages_list = [f"{p}{python_deps[p]}" for p in packages_to_install] |
| 256 | + packages_list = [] |
| 257 | + for p in packages_to_install: |
| 258 | + spec = python_deps[p] |
| 259 | + if spec.startswith(('http://', 'https://', 'git+', 'file://')): |
| 260 | + packages_list.append(spec) |
| 261 | + else: |
| 262 | + packages_list.append(f"{p}{spec}") |
246 | 263 |
|
247 | 264 | cmd = [
|
248 | 265 | uv_executable, "pip", "install",
|
|
0 commit comments