[validation] Add `host to require_framework_version` (#7107)

This commit is contained in:
Jesse Hills 2024-07-22 07:54:16 +12:00 committed by GitHub
parent 32b927de7e
commit 43b818f2b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -829,7 +829,6 @@ def time_of_day(value):
def date_time(date: bool, time: bool): def date_time(date: bool, time: bool):
pattern_str = r"^" # Start of string pattern_str = r"^" # Start of string
if date: if date:
pattern_str += r"\d{4}-\d{1,2}-\d{1,2}" pattern_str += r"\d{4}-\d{1,2}-\d{1,2}"
@ -2031,6 +2030,7 @@ def require_framework_version(
esp32_arduino=None, esp32_arduino=None,
esp8266_arduino=None, esp8266_arduino=None,
rp2040_arduino=None, rp2040_arduino=None,
host=None,
max_version=False, max_version=False,
extra_message=None, extra_message=None,
): ):
@ -2065,6 +2065,13 @@ def require_framework_version(
msg += f". {extra_message}" msg += f". {extra_message}"
raise Invalid(msg) raise Invalid(msg)
required = rp2040_arduino required = rp2040_arduino
elif CORE.is_host and framework == "host":
if host is None:
msg = "This feature is incompatible with host platform"
if extra_message:
msg += f". {extra_message}"
raise Invalid(msg)
required = host
else: else:
raise Invalid( raise Invalid(
f""" f"""