mirror of
https://github.com/esphome/esphome.git
synced 2025-09-06 05:12:21 +01:00
Allow setting URL as platform_version (#2598)
This commit is contained in:
@@ -1668,6 +1668,25 @@ def version_number(value):
|
||||
raise Invalid("Not a version number") from e
|
||||
|
||||
|
||||
def platformio_version_constraint(value):
|
||||
# for documentation on valid version constraints:
|
||||
# https://docs.platformio.org/en/latest/core/userguide/platforms/cmd_install.html#cmd-platform-install
|
||||
|
||||
value = string_strict(value)
|
||||
constraints = []
|
||||
for item in value.split(","):
|
||||
# find and strip prefix operator
|
||||
op = None
|
||||
for test_op in ("^", "~", ">=", ">", "<=", "<", "!="):
|
||||
if item.startswith(test_op):
|
||||
op = test_op
|
||||
item = item[len(test_op) :]
|
||||
break
|
||||
|
||||
constraints.append((op, version_number(item)))
|
||||
return constraints
|
||||
|
||||
|
||||
def require_framework_version(
|
||||
*,
|
||||
esp_idf=None,
|
||||
|
Reference in New Issue
Block a user