From bfea6ca79b0efef95b09f6f688665f0ececee616 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 12 Nov 2019 21:44:28 +0100 Subject: [PATCH] Mark python 3.5 support deprecated (#849) * Mark python 3.5 unsupported Fixes https://github.com/esphome/issues/issues/831 * Update .travis.yml * Update typing dep --- .travis.yml | 6 +++--- esphome/__main__.py | 6 +++++- setup.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index aa848877c6..c7f75a2cb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ sudo: false language: python -python: '3.5' +python: '3.6' install: script/setup cache: directories: @@ -15,8 +15,8 @@ matrix: - script/ci-custom.py - flake8 esphome - pylint esphome - - python: "3.5" - env: TARGET=Test3.5 + - python: "3.6" + env: TARGET=Test3.6 script: - esphome tests/test1.yaml compile - esphome tests/test2.yaml compile diff --git a/esphome/__main__.py b/esphome/__main__.py index 6d3705c87e..3bc681afba 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -14,7 +14,7 @@ from esphome.const import CONF_BAUD_RATE, CONF_BROKER, CONF_LOGGER, CONF_OTA, \ CONF_PASSWORD, CONF_PORT, CONF_ESPHOME, CONF_PLATFORMIO_OPTIONS from esphome.core import CORE, EsphomeError, coroutine, coroutine_with_priority from esphome.helpers import color, indent -from esphome.py_compat import IS_PY2, safe_input +from esphome.py_compat import IS_PY2, safe_input, IS_PY3 from esphome.util import run_external_command, run_external_process, safe_print, list_yaml_files _LOGGER = logging.getLogger(__name__) @@ -514,6 +514,10 @@ def run_esphome(argv): _LOGGER.warning("You're using ESPHome with python 2. Support for python 2 is deprecated " "and will be removed in 1.15.0. Please reinstall ESPHome with python 3.6 " "or higher.") + elif IS_PY3 and sys.version_info < (3, 6, 0): + _LOGGER.warning("You're using ESPHome with python 3.5. Support for python 3.5 is " + "deprecated and will be removed in 1.15.0. Please reinstall ESPHome with " + "python 3.6 or higher.") if args.command in PRE_CONFIG_ACTIONS: try: diff --git a/setup.py b/setup.py index 53acef5a30..641bb3e431 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ REQUIRES = [ 'paho-mqtt==1.4.0', 'colorlog==4.0.2', 'tornado==5.1.1', - 'typing>=3.6.6;python_version<"3.5"', + 'typing>=3.6.6;python_version<"3.6"', 'protobuf==3.10.0', 'tzlocal==2.0.0', 'pytz==2019.3',