From 7df51dc54528418412d43c64887f2d550841e33a Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Sun, 22 Jan 2017 01:31:10 +0200 Subject: [PATCH 1/2] gen_requirement: Raise an error if REQUIREMENT not pinned --- script/gen_requirements_all.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 81fb17aac17..537b93d173a 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -26,6 +26,8 @@ IGNORE_PACKAGES = ( 'homeassistant.components.recorder.models', ) +IGNORE_PIN = ('colorlog>2.1,<3', 'keyring>=9.3,<10.0', 'urllib3') + def explore_module(package, explore_children): """Explore the modules.""" @@ -78,6 +80,9 @@ def gather_modules(): continue for req in module.REQUIREMENTS: + if req.partition('==')[1] == '' and req not in IGNORE_PIN: + errors.append("{}[Please pin requirement {}]" + .format(package, req)) reqs.setdefault(req, []).append(package) for key in reqs: From 699c615d23ab26edf5e5d099866736ef2cd9acf9 Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Sun, 22 Jan 2017 18:34:00 +0200 Subject: [PATCH 2/2] Add url --- script/gen_requirements_all.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 537b93d173a..33c444cb3a6 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -28,6 +28,9 @@ IGNORE_PACKAGES = ( IGNORE_PIN = ('colorlog>2.1,<3', 'keyring>=9.3,<10.0', 'urllib3') +URL_PIN = ('https://home-assistant.io/developers/code_review_platform/' + '#1-requirements') + def explore_module(package, explore_children): """Explore the modules.""" @@ -81,8 +84,9 @@ def gather_modules(): for req in module.REQUIREMENTS: if req.partition('==')[1] == '' and req not in IGNORE_PIN: - errors.append("{}[Please pin requirement {}]" - .format(package, req)) + errors.append( + "{}[Please pin requirement {}, see {}]".format( + package, req, URL_PIN)) reqs.setdefault(req, []).append(package) for key in reqs: