mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Add pyserial-asyncio to forbidden packages (#145625)
This commit is contained in:
parent
8fb4f1f7f9
commit
039383ab22
@ -41,7 +41,19 @@ PACKAGE_REGEX = re.compile(
|
|||||||
PIP_REGEX = re.compile(r"^(--.+\s)?([-_\.\w\d]+.*(?:==|>=|<=|~=|!=|<|>|===)?.*$)")
|
PIP_REGEX = re.compile(r"^(--.+\s)?([-_\.\w\d]+.*(?:==|>=|<=|~=|!=|<|>|===)?.*$)")
|
||||||
PIP_VERSION_RANGE_SEPARATOR = re.compile(r"^(==|>=|<=|~=|!=|<|>|===)?(.*)$")
|
PIP_VERSION_RANGE_SEPARATOR = re.compile(r"^(==|>=|<=|~=|!=|<|>|===)?(.*)$")
|
||||||
|
|
||||||
FORBIDDEN_PACKAGES = {"codecov", "pytest", "setuptools", "wheel"}
|
FORBIDDEN_PACKAGES = {
|
||||||
|
# Only needed for tests
|
||||||
|
"codecov": "not be a runtime dependency",
|
||||||
|
# Does blocking I/O and should be replaced by pyserial-asyncio-fast
|
||||||
|
# See https://github.com/home-assistant/core/pull/116635
|
||||||
|
"pyserial-asyncio": "be replaced by pyserial-asyncio-fast",
|
||||||
|
# Only needed for tests
|
||||||
|
"pytest": "not be a runtime dependency",
|
||||||
|
# Only needed for build
|
||||||
|
"setuptools": "not be a runtime dependency",
|
||||||
|
# Only needed for build
|
||||||
|
"wheel": "not be a runtime dependency",
|
||||||
|
}
|
||||||
FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
||||||
# In the form dict("domain": {"package": {"reason1", "reason2"}})
|
# In the form dict("domain": {"package": {"reason1", "reason2"}})
|
||||||
# - domain is the integration domain
|
# - domain is the integration domain
|
||||||
@ -52,6 +64,11 @@ FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
|||||||
# aioazuredevops > incremental > setuptools
|
# aioazuredevops > incremental > setuptools
|
||||||
"incremental": {"setuptools"}
|
"incremental": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"blackbird": {
|
||||||
|
# https://github.com/koolsb/pyblackbird/issues/12
|
||||||
|
# pyblackbird > pyserial-asyncio
|
||||||
|
"pyblackbird": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"cmus": {
|
"cmus": {
|
||||||
# https://github.com/mtreinish/pycmus/issues/4
|
# https://github.com/mtreinish/pycmus/issues/4
|
||||||
# pycmus > pbr > setuptools
|
# pycmus > pbr > setuptools
|
||||||
@ -62,12 +79,22 @@ FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
|||||||
# concord232 > stevedore > pbr > setuptools
|
# concord232 > stevedore > pbr > setuptools
|
||||||
"pbr": {"setuptools"}
|
"pbr": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"edl21": {
|
||||||
|
# https://github.com/mtdcr/pysml/issues/21
|
||||||
|
# pysml > pyserial-asyncio
|
||||||
|
"pysml": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"efergy": {
|
"efergy": {
|
||||||
# https://github.com/tkdrob/pyefergy/issues/46
|
# https://github.com/tkdrob/pyefergy/issues/46
|
||||||
# pyefergy > codecov
|
# pyefergy > codecov
|
||||||
# pyefergy > types-pytz
|
# pyefergy > types-pytz
|
||||||
"pyefergy": {"codecov", "types-pytz"}
|
"pyefergy": {"codecov", "types-pytz"}
|
||||||
},
|
},
|
||||||
|
"epson": {
|
||||||
|
# https://github.com/pszafer/epson_projector/pull/22
|
||||||
|
# epson-projector > pyserial-asyncio
|
||||||
|
"epson-projector": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"fitbit": {
|
"fitbit": {
|
||||||
# https://github.com/orcasgit/python-fitbit/pull/178
|
# https://github.com/orcasgit/python-fitbit/pull/178
|
||||||
# but project seems unmaintained
|
# but project seems unmaintained
|
||||||
@ -79,16 +106,31 @@ FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
|||||||
# aioguardian > asyncio-dgram > setuptools
|
# aioguardian > asyncio-dgram > setuptools
|
||||||
"asyncio-dgram": {"setuptools"}
|
"asyncio-dgram": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"heatmiser": {
|
||||||
|
# https://github.com/andylockran/heatmiserV3/issues/96
|
||||||
|
# heatmiserV3 > pyserial-asyncio
|
||||||
|
"heatmiserv3": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"hive": {
|
"hive": {
|
||||||
# https://github.com/Pyhass/Pyhiveapi/pull/88
|
# https://github.com/Pyhass/Pyhiveapi/pull/88
|
||||||
# pyhive-integration > unasync > setuptools
|
# pyhive-integration > unasync > setuptools
|
||||||
"unasync": {"setuptools"}
|
"unasync": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"homeassistant_hardware": {
|
||||||
|
# https://github.com/zigpy/zigpy/issues/1604
|
||||||
|
# universal-silabs-flasher > zigpy > pyserial-asyncio
|
||||||
|
"zigpy": {"pyserial-asyncio"},
|
||||||
|
},
|
||||||
"influxdb": {
|
"influxdb": {
|
||||||
# https://github.com/influxdata/influxdb-client-python/issues/695
|
# https://github.com/influxdata/influxdb-client-python/issues/695
|
||||||
# influxdb-client > setuptools
|
# influxdb-client > setuptools
|
||||||
"influxdb-client": {"setuptools"}
|
"influxdb-client": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"insteon": {
|
||||||
|
# https://github.com/pyinsteon/pyinsteon/issues/430
|
||||||
|
# pyinsteon > pyserial-asyncio
|
||||||
|
"pyinsteon": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"keba": {
|
"keba": {
|
||||||
# https://github.com/jsbronder/asyncio-dgram/issues/20
|
# https://github.com/jsbronder/asyncio-dgram/issues/20
|
||||||
# keba-kecontact > asyncio-dgram > setuptools
|
# keba-kecontact > asyncio-dgram > setuptools
|
||||||
@ -114,11 +156,26 @@ FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
|||||||
# pymochad > pbr > setuptools
|
# pymochad > pbr > setuptools
|
||||||
"pbr": {"setuptools"}
|
"pbr": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"monoprice": {
|
||||||
|
# https://github.com/etsinko/pymonoprice/issues/9
|
||||||
|
# pymonoprice > pyserial-asyncio
|
||||||
|
"pymonoprice": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
|
"mysensors": {
|
||||||
|
# https://github.com/theolind/pymysensors/issues/818
|
||||||
|
# pymysensors > pyserial-asyncio
|
||||||
|
"pymysensors": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"mystrom": {
|
"mystrom": {
|
||||||
# https://github.com/home-assistant-ecosystem/python-mystrom/issues/55
|
# https://github.com/home-assistant-ecosystem/python-mystrom/issues/55
|
||||||
# python-mystrom > setuptools
|
# python-mystrom > setuptools
|
||||||
"python-mystrom": {"setuptools"}
|
"python-mystrom": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"ness_alarm": {
|
||||||
|
# https://github.com/nickw444/nessclient/issues/73
|
||||||
|
# nessclient > pyserial-asyncio
|
||||||
|
"nessclient": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"nx584": {
|
"nx584": {
|
||||||
# https://bugs.launchpad.net/python-stevedore/+bug/2111694
|
# https://bugs.launchpad.net/python-stevedore/+bug/2111694
|
||||||
# pynx584 > stevedore > pbr > setuptools
|
# pynx584 > stevedore > pbr > setuptools
|
||||||
@ -149,6 +206,11 @@ FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
|||||||
# gpiozero > colorzero > setuptools
|
# gpiozero > colorzero > setuptools
|
||||||
"colorzero": {"setuptools"}
|
"colorzero": {"setuptools"}
|
||||||
},
|
},
|
||||||
|
"rflink": {
|
||||||
|
# https://github.com/aequitas/python-rflink/issues/78
|
||||||
|
# rflink > pyserial-asyncio
|
||||||
|
"rflink": {"pyserial-asyncio"}
|
||||||
|
},
|
||||||
"system_bridge": {
|
"system_bridge": {
|
||||||
# https://github.com/timmo001/system-bridge-connector/pull/78
|
# https://github.com/timmo001/system-bridge-connector/pull/78
|
||||||
# systembridgeconnector > incremental > setuptools
|
# systembridgeconnector > incremental > setuptools
|
||||||
@ -165,7 +227,10 @@ FORBIDDEN_PACKAGE_EXCEPTIONS: dict[str, dict[str, set[str]]] = {
|
|||||||
"zha": {
|
"zha": {
|
||||||
# https://github.com/waveform80/colorzero/issues/9
|
# https://github.com/waveform80/colorzero/issues/9
|
||||||
# zha > zigpy-zigate > gpiozero > colorzero > setuptools
|
# zha > zigpy-zigate > gpiozero > colorzero > setuptools
|
||||||
"colorzero": {"setuptools"}
|
"colorzero": {"setuptools"},
|
||||||
|
# https://github.com/zigpy/zigpy/issues/1604
|
||||||
|
# zha > zigpy > pyserial-asyncio
|
||||||
|
"zigpy": {"pyserial-asyncio"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,8 +408,6 @@ def get_requirements(integration: Integration, packages: set[str]) -> set[str]:
|
|||||||
all_requirements.add(package)
|
all_requirements.add(package)
|
||||||
|
|
||||||
item = deptree.get(package)
|
item = deptree.get(package)
|
||||||
if forbidden_package_exceptions:
|
|
||||||
print(f"Integration {integration.domain}: {item}")
|
|
||||||
|
|
||||||
if item is None:
|
if item is None:
|
||||||
# Only warn if direct dependencies could not be resolved
|
# Only warn if direct dependencies could not be resolved
|
||||||
@ -358,16 +421,17 @@ def get_requirements(integration: Integration, packages: set[str]) -> set[str]:
|
|||||||
package_exceptions = forbidden_package_exceptions.get(package, set())
|
package_exceptions = forbidden_package_exceptions.get(package, set())
|
||||||
for pkg, version in dependencies.items():
|
for pkg, version in dependencies.items():
|
||||||
if pkg.startswith("types-") or pkg in FORBIDDEN_PACKAGES:
|
if pkg.startswith("types-") or pkg in FORBIDDEN_PACKAGES:
|
||||||
|
reason = FORBIDDEN_PACKAGES.get(pkg, "not be a runtime dependency")
|
||||||
needs_forbidden_package_exceptions = True
|
needs_forbidden_package_exceptions = True
|
||||||
if pkg in package_exceptions:
|
if pkg in package_exceptions:
|
||||||
integration.add_warning(
|
integration.add_warning(
|
||||||
"requirements",
|
"requirements",
|
||||||
f"Package {pkg} should not be a runtime dependency in {package}",
|
f"Package {pkg} should {reason} in {package}",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
integration.add_error(
|
integration.add_error(
|
||||||
"requirements",
|
"requirements",
|
||||||
f"Package {pkg} should not be a runtime dependency in {package}",
|
f"Package {pkg} should {reason} in {package}",
|
||||||
)
|
)
|
||||||
check_dependency_version_range(integration, package, pkg, version)
|
check_dependency_version_range(integration, package, pkg, version)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user