From fc46a2499649c8a8207e26a07a6cfdde9a7a6047 Mon Sep 17 00:00:00 2001 From: siebert Date: Sun, 12 Mar 2017 20:08:49 +0100 Subject: [PATCH] Fix gen_requirements_all.py script for Windows. (#6547) --- script/gen_requirements_all.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 2b7721d2d35..bb7307c7281 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -30,6 +30,10 @@ IGNORE_PACKAGES = ( IGNORE_PIN = ('colorlog>2.1,<3', 'keyring>=9.3,<10.0', 'urllib3') +IGNORE_REQ = ( + 'colorama<=1', # Windows only requirement in check_config +) + URL_PIN = ('https://home-assistant.io/developers/code_review_platform/' '#1-requirements') @@ -85,6 +89,8 @@ def gather_modules(): continue for req in module.REQUIREMENTS: + if req in IGNORE_REQ: + continue if req.partition('==')[1] == '' and req not in IGNORE_PIN: errors.append( "{}[Please pin requirement {}, see {}]".format( @@ -120,7 +126,7 @@ def gather_modules(): def write_file(data): """Write the modules to the requirements_all.txt.""" - with open('requirements_all.txt', 'w+') as req_file: + with open('requirements_all.txt', 'w+', newline="\n") as req_file: req_file.write(data)