Skip to content

Commit

Permalink
Require minimum PlatformIO version (MarlinFirmware#20361)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
Co-authored-by: Jason Smith <[email protected]>
  • Loading branch information
3 people committed Apr 29, 2021
1 parent 15c8f9c commit 813ae63
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions buildroot/share/PlatformIO/scripts/common-dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@
# PIO >= 4.4
from platformio.package.meta import PackageSpec as PackageManager

PIO_VERSION_MIN = (5, 0, 3)
try:
from platformio import VERSION as PIO_VERSION
weights = (1000, 100, 1)
version_min = sum([x[0] * float(re.sub(r'[^0-9]', '.', str(x[1]))) for x in zip(weights, PIO_VERSION_MIN)])
version_cur = sum([x[0] * float(re.sub(r'[^0-9]', '.', str(x[1]))) for x in zip(weights, PIO_VERSION)])
if version_cur < version_min:
print()
print("**************************************************")
print("****** An update to PlatformIO is ******")
print("****** required to build Marlin Firmware. ******")
print("****** ******")
print("****** Minimum version: ", PIO_VERSION_MIN, " ******")
print("****** Current Version: ", PIO_VERSION, " ******")
print("****** ******")
print("****** Update PlatformIO and try again. ******")
print("**************************************************")
print()
exit(1)
except SystemExit:
exit(1)
except:
print("Can't detect PlatformIO Version")

Import("env")

#print(env.Dump())
Expand Down

0 comments on commit 813ae63

Please sign in to comment.