Script/gen_requirements: Ignore package families (#12963)

* Added fnmatch for IGNORE_PACKAGE_FAMILIES
This commit is contained in:
cdce8p 2018-03-09 00:28:49 +01:00 committed by GitHub
parent 6d7dbe5536
commit eaf525d41d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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