Script/gen_requirements: Ignore package families (#12963)
* Added fnmatch for IGNORE_PACKAGE_FAMILIES
This commit is contained in:
parent
6d7dbe5536
commit
eaf525d41d
1 changed files with 6 additions and 7 deletions
|
@ -5,6 +5,7 @@ import os
|
|||
import pkgutil
|
||||
import re
|
||||
import sys
|
||||
import fnmatch
|
||||
|
||||
COMMENT_REQUIREMENTS = (
|
||||
'RPi.GPIO',
|
||||
|
@ -93,12 +94,7 @@ TEST_REQUIREMENTS = (
|
|||
|
||||
IGNORE_PACKAGES = (
|
||||
'homeassistant.components.recorder.models',
|
||||
'homeassistant.components.homekit.accessories',
|
||||
'homeassistant.components.homekit.covers',
|
||||
'homeassistant.components.homekit.security_systems',
|
||||
'homeassistant.components.homekit.sensors',
|
||||
'homeassistant.components.homekit.switches',
|
||||
'homeassistant.components.homekit.thermostats'
|
||||
'homeassistant.components.homekit.*'
|
||||
)
|
||||
|
||||
IGNORE_PIN = ('colorlog>2.1,<3', 'keyring>=9.3,<10.0', 'urllib3')
|
||||
|
@ -164,7 +160,10 @@ def gather_modules():
|
|||
try:
|
||||
module = importlib.import_module(package)
|
||||
except ImportError:
|
||||
if package not in IGNORE_PACKAGES:
|
||||
for pattern in IGNORE_PACKAGES:
|
||||
if fnmatch.fnmatch(package, pattern):
|
||||
break
|
||||
else:
|
||||
errors.append(package)
|
||||
continue
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue