From bba6d6897d140b45fc7eafff26d0330c1df7af79 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 4 Dec 2019 17:13:34 +0100 Subject: [PATCH] Update dependencies (#906) PyYAML 5.1.2 -> 5.2 https://github.com/yaml/pyyaml/blob/master/CHANGES flake8 3.6.0 -> 3.7.9 https://github.com/PyCQA/flake8/tree/master/docs/source/release-notes paho-mqtt 1.4.0 -> 1.5.0 https://github.com/eclipse/paho.mqtt.python/blob/master/ChangeLog.txt platformio 4.0.3 -> 4.1.0 https://github.com/platformio/platformio-core/releases protobuf 3.10.0 -> 3.11.1 https://github.com/protocolbuffers/protobuf/releases pylint 2.3.0 -> 2.4.4 http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-4-4 --- esphome/components/time/__init__.py | 12 ++++++------ esphome/core.py | 10 +++++----- esphome/cpp_helpers.py | 2 +- esphome/storage_json.py | 4 ++-- esphome/vscode.py | 8 ++++++-- esphome/writer.py | 2 +- pylintrc | 1 + requirements.txt | 8 ++++---- requirements_test.txt | 12 ++++++------ setup.cfg | 2 +- setup.py | 8 ++++---- 11 files changed, 37 insertions(+), 32 deletions(-) diff --git a/esphome/components/time/__init__.py b/esphome/components/time/__init__.py index ca1ac375ba..58739772b0 100644 --- a/esphome/components/time/__init__.py +++ b/esphome/components/time/__init__.py @@ -301,17 +301,17 @@ def setup_time_core_(time_var, config): for conf in config.get(CONF_ON_TIME, []): trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], time_var) - seconds = conf.get(CONF_SECONDS, [x for x in range(0, 61)]) + seconds = conf.get(CONF_SECONDS, list(range(0, 61))) cg.add(trigger.add_seconds(seconds)) - minutes = conf.get(CONF_MINUTES, [x for x in range(0, 60)]) + minutes = conf.get(CONF_MINUTES, list(range(0, 60))) cg.add(trigger.add_minutes(minutes)) - hours = conf.get(CONF_HOURS, [x for x in range(0, 24)]) + hours = conf.get(CONF_HOURS, list(range(0, 24))) cg.add(trigger.add_hours(hours)) - days_of_month = conf.get(CONF_DAYS_OF_MONTH, [x for x in range(1, 32)]) + days_of_month = conf.get(CONF_DAYS_OF_MONTH, list(range(1, 32))) cg.add(trigger.add_days_of_month(days_of_month)) - months = conf.get(CONF_MONTHS, [x for x in range(1, 13)]) + months = conf.get(CONF_MONTHS, list(range(1, 13))) cg.add(trigger.add_months(months)) - days_of_week = conf.get(CONF_DAYS_OF_WEEK, [x for x in range(1, 8)]) + days_of_week = conf.get(CONF_DAYS_OF_WEEK, list(range(1, 8))) cg.add(trigger.add_days_of_week(days_of_week)) yield cg.register_component(trigger, conf) diff --git a/esphome/core.py b/esphome/core.py index 82ce196cab..9df30384bc 100644 --- a/esphome/core.py +++ b/esphome/core.py @@ -8,7 +8,7 @@ import os import re # pylint: disable=unused-import, wrong-import-order -from typing import Any, Dict, List # noqa +from typing import Any, Dict, List, Optional, Set # noqa from esphome.const import CONF_ARDUINO_VERSION, SOURCE_FILE_EXTENSIONS, \ CONF_COMMENT, CONF_ESPHOME, CONF_USE_ADDRESS, CONF_WIFI @@ -271,7 +271,7 @@ class ID(object): else: self.is_manual = is_manual self.is_declaration = is_declaration - self.type = type # type: Optional[MockObjClass] + self.type = type # type: Optional['MockObjClass'] def resolve(self, registered_ids): from esphome.config_validation import RESERVED_IDS @@ -489,11 +489,11 @@ class EsphomeCore(object): # Task counter for pending tasks self.task_counter = 0 # The variable cache, for each ID this holds a MockObj of the variable obj - self.variables = {} # type: Dict[str, MockObj] + self.variables = {} # type: Dict[str, 'MockObj'] # A list of statements that go in the main setup() block - self.main_statements = [] # type: List[Statement] + self.main_statements = [] # type: List['Statement'] # A list of statements to insert in the global block (includes and global variables) - self.global_statements = [] # type: List[Statement] + self.global_statements = [] # type: List['Statement'] # A set of platformio libraries to add to the project self.libraries = [] # type: List[Library] # A set of build flags to set in the platformio project diff --git a/esphome/cpp_helpers.py b/esphome/cpp_helpers.py index fd79feec1c..39ac8e7118 100644 --- a/esphome/cpp_helpers.py +++ b/esphome/cpp_helpers.py @@ -59,7 +59,7 @@ def register_parented(var, value): def extract_registry_entry_config(registry, full_config): - # type: (Registry, ConfigType) -> RegistryEntry + # type: ('Registry', 'ConfigType') -> 'RegistryEntry' key, config = next((k, v) for k, v in full_config.items() if k in registry) return registry[key], config diff --git a/esphome/storage_json.py b/esphome/storage_json.py index e1b4070d3b..f3e53ce168 100644 --- a/esphome/storage_json.py +++ b/esphome/storage_json.py @@ -10,8 +10,8 @@ from esphome.core import CORE from esphome.helpers import write_file_if_changed # pylint: disable=unused-import, wrong-import-order -from esphome.core import CoreType # noqa -from typing import Any, Dict, Optional # noqa +from esphome.core import CoreType +from typing import Any, Optional, List from esphome.py_compat import text_type diff --git a/esphome/vscode.py b/esphome/vscode.py index 151bfb5281..6b35d4bd7a 100644 --- a/esphome/vscode.py +++ b/esphome/vscode.py @@ -3,10 +3,14 @@ from __future__ import print_function import json import os -from esphome.config import load_config, _format_vol_invalid -from esphome.core import CORE +from esphome.config import load_config, _format_vol_invalid, Config +from esphome.core import CORE, DocumentRange from esphome.py_compat import text_type, safe_input +# pylint: disable=unused-import, wrong-import-order +import voluptuous as vol +from typing import Optional + def _get_invalid_range(res, invalid): # type: (Config, vol.Invalid) -> Optional[DocumentRange] diff --git a/esphome/writer.py b/esphome/writer.py index 1961af5a15..b036413a66 100644 --- a/esphome/writer.py +++ b/esphome/writer.py @@ -291,7 +291,7 @@ def copy_src_tree(): source_files.update(component.source_files) # Convert to list and sort - source_files_l = [it for it in source_files.items()] + source_files_l = list(source_files.items()) source_files_l.sort() # Build #include list for esphome.h diff --git a/pylintrc b/pylintrc index b011e2750c..89cc73656f 100644 --- a/pylintrc +++ b/pylintrc @@ -24,6 +24,7 @@ disable= useless-object-inheritance, stop-iteration-return, no-self-use, + import-outside-toplevel, additional-builtins= diff --git a/requirements.txt b/requirements.txt index 14ce062000..b8af2a605b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,13 @@ voluptuous==0.11.7 -PyYAML==5.1.2 -paho-mqtt==1.4.0 +PyYAML==5.2 +paho-mqtt==1.5.0 colorlog==4.0.2 tornado==5.1.1 typing>=3.6.6;python_version<"3.5" -protobuf==3.10.0 +protobuf==3.11.1 tzlocal==2.0.0 pytz==2019.3 pyserial==3.4 ifaddr==0.1.6 -platformio==4.0.3 +platformio==4.1.0 esptool==2.7 diff --git a/requirements_test.txt b/requirements_test.txt index 26f14434d8..ff02badf80 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,19 +1,19 @@ voluptuous==0.11.7 -PyYAML==5.1.2 -paho-mqtt==1.4.0 +PyYAML==5.2 +paho-mqtt==1.5.0 colorlog==4.0.2 tornado==5.1.1 typing>=3.6.6;python_version<"3.5" -protobuf==3.10.0 +protobuf==3.11.1 tzlocal==2.0.0 pytz==2019.3 pyserial==3.4 ifaddr==0.1.6 -platformio==4.0.3 +platformio==4.1.0 esptool==2.7 pylint==1.9.4 ; python_version<"3" -pylint==2.3.0 ; python_version>"3" -flake8==3.6.0 +pylint==2.4.4 ; python_version>"3" +flake8==3.7.9 pillow pexpect diff --git a/setup.cfg b/setup.cfg index e3521f48b7..bef998fb37 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,7 @@ Topic :: Home Automation [flake8] max-line-length = 120 -builtins = unicode, long, raw_input +builtins = unicode, long, raw_input, basestring exclude = api_pb2.py [bdist_wheel] diff --git a/setup.py b/setup.py index 641bb3e431..1d4fb3a4d0 100755 --- a/setup.py +++ b/setup.py @@ -24,12 +24,12 @@ DOWNLOAD_URL = '{}/archive/v{}.zip'.format(GITHUB_URL, const.__version__) REQUIRES = [ 'voluptuous==0.11.7', - 'PyYAML==5.1.2', - 'paho-mqtt==1.4.0', + 'PyYAML==5.2', + 'paho-mqtt==1.5.0', 'colorlog==4.0.2', 'tornado==5.1.1', 'typing>=3.6.6;python_version<"3.6"', - 'protobuf==3.10.0', + 'protobuf==3.11.1', 'tzlocal==2.0.0', 'pytz==2019.3', 'pyserial==3.4', @@ -41,7 +41,7 @@ REQUIRES = [ # This means they have to be in your $PATH. if os.environ.get('ESPHOME_USE_SUBPROCESS') is None: REQUIRES.extend([ - 'platformio==4.0.3', + 'platformio==4.1.0', 'esptool==2.7', ])