
import json
import subprocess
import sys
from platformio import util


def main():
    platforms = json.loads(
        subprocess.check_output(
            ["platformio", "platform", "search", "--json-output"]).decode())
    for platform in platforms:
        if platform['forDesktop']:
            continue
        # RISC-V GAP does not support Windows 86
        if (util.get_systype() == "windows_x86"
                and platform['name'] == "riscv_gap"):
            continue
        # unknown issue on Linux
        if ("linux" in util.get_systype()
                and platform['name'] == "aceinna_imu"):
            continue
        subprocess.check_call(
            ["platformio", "platform", "install", platform['repository']])


if __name__ == "__main__":
    sys.exit(main())


import json
import subprocess
import sys
from platformio import util


def main():
    platforms = json.loads(
        subprocess.check_output(
            ["platformio", "platform", "search", "--json-output"]).decode())
    for platform in platforms:
        if platform['forDesktop']:
            continue
        # RISC-V GAP does not support Windows 86
        if (util.get_systype() == "windows_x86"
                and platform['name'] == "riscv_gap"):
            continue
        # unknown issue on Linux
        if ("linux" in util.get_systype()
                and platform['name'] == "aceinna_imu"):
            continue
        subprocess.check_call(
            ["platformio", "platform", "install", platform['name']])


if __name__ == "__main__":
    sys.exit(main())

Use stable dev/platforms for CI
Use stable dev/platforms for CI

  
  import json
  import subprocess
  import sys
  from platformio import util
  
  
  def main():
      platforms = json.loads(
          subprocess.check_output(
              ["platformio", "platform", "search", "--json-output"]).decode())
      for platform in platforms:
          if platform['forDesktop']:
              continue
          # RISC-V GAP does not support Windows 86
          if (util.get_systype() == "windows_x86"
                  and platform['name'] == "riscv_gap"):
              continue
          # unknown issue on Linux
          if ("linux" in util.get_systype()
                  and platform['name'] == "aceinna_imu"):
              continue
          subprocess.check_call(
-             ["platformio", "platform", "install", platform['repository']])
+             ["platformio", "platform", "install", platform['name']])
  
  
  if __name__ == "__main__":
      sys.exit(main())
  
Use stable dev/platforms for CI
## Code Before:

import json
import subprocess
import sys
from platformio import util


def main():
    platforms = json.loads(
        subprocess.check_output(
            ["platformio", "platform", "search", "--json-output"]).decode())
    for platform in platforms:
        if platform['forDesktop']:
            continue
        # RISC-V GAP does not support Windows 86
        if (util.get_systype() == "windows_x86"
                and platform['name'] == "riscv_gap"):
            continue
        # unknown issue on Linux
        if ("linux" in util.get_systype()
                and platform['name'] == "aceinna_imu"):
            continue
        subprocess.check_call(
            ["platformio", "platform", "install", platform['repository']])


if __name__ == "__main__":
    sys.exit(main())

## Instruction:
Use stable dev/platforms for CI
## Code After:

import json
import subprocess
import sys
from platformio import util


def main():
    platforms = json.loads(
        subprocess.check_output(
            ["platformio", "platform", "search", "--json-output"]).decode())
    for platform in platforms:
        if platform['forDesktop']:
            continue
        # RISC-V GAP does not support Windows 86
        if (util.get_systype() == "windows_x86"
                and platform['name'] == "riscv_gap"):
            continue
        # unknown issue on Linux
        if ("linux" in util.get_systype()
                and platform['name'] == "aceinna_imu"):
            continue
        subprocess.check_call(
            ["platformio", "platform", "install", platform['name']])


if __name__ == "__main__":
    sys.exit(main())
