From 3cf8964c069b22d65c14b9a2745c85e40ac2dbc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 31 Jul 2019 22:21:15 +0300 Subject: [PATCH] Python < 3.6 remainder cleanups (#25607) --- .travis.yml | 10 +++++----- homeassistant/__main__.py | 3 +-- homeassistant/bootstrap.py | 7 ------- homeassistant/core.py | 8 ++++---- setup.cfg | 1 - tox.ini | 2 +- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4167b1c9923e34..f54f4027de4ea1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,14 +16,14 @@ addons: matrix: fast_finish: true include: - - python: "3.5.3" + - python: "3.6" env: TOXENV=lint - - python: "3.5.3" + - python: "3.6" env: TOXENV=pylint - - python: "3.5.3" + - python: "3.6" env: TOXENV=typing - - python: "3.5.3" - env: TOXENV=py35 + - python: "3.6" + env: TOXENV=py36 - python: "3.7" env: TOXENV=py37 diff --git a/homeassistant/__main__.py b/homeassistant/__main__.py index 023faadef0c658..53e24815ee6c39 100644 --- a/homeassistant/__main__.py +++ b/homeassistant/__main__.py @@ -356,8 +356,7 @@ def main() -> int: monkey_patch_needed = sys.version_info[:3] < (3, 6, 3) if monkey_patch_needed and os.environ.get('HASS_NO_MONKEY') != '1': - if sys.version_info[:2] >= (3, 6): - monkey_patch.disable_c_asyncio() + monkey_patch.disable_c_asyncio() monkey_patch.patch_weakref_tasks() set_loop() diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 85611be8d65a0f..650ca8e4111647 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -93,13 +93,6 @@ async def async_from_config_dict(config: Dict[str, Any], stop = time() _LOGGER.info("Home Assistant initialized in %.2fs", stop-start) - if sys.version_info[:3] < (3, 6, 0): - hass.components.persistent_notification.async_create( - "Python 3.5 support is deprecated and will " - "be removed in the first release after August 1. Please " - "upgrade Python.", "Python version", "python_version" - ) - return hass diff --git a/homeassistant/core.py b/homeassistant/core.py index 006e41fd9a8696..df1b5c5449b8bb 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -12,7 +12,6 @@ import logging import os import pathlib -import sys import threading from time import monotonic import uuid @@ -142,9 +141,10 @@ def __init__( self.loop: asyncio.events.AbstractEventLoop = ( loop or asyncio.get_event_loop()) - executor_opts = {'max_workers': None} # type: Dict[str, Any] - if sys.version_info[:2] >= (3, 6): - executor_opts['thread_name_prefix'] = 'SyncWorker' + executor_opts = { + 'max_workers': None, + 'thread_name_prefix': 'SyncWorker', + } # type: Dict[str, Any] self.executor = ThreadPoolExecutor(**executor_opts) self.loop.set_default_executor(self.executor) diff --git a/setup.cfg b/setup.cfg index 936840acfaa1d9..38999850cd35c3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,6 @@ classifier = Intended Audience :: Developers License :: OSI Approved :: Apache Software License Operating System :: OS Independent - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Topic :: Home Automation diff --git a/tox.ini b/tox.ini index f6311fe488e5df..dd7206f403a643 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35, py36, py37, py38, lint, pylint, typing, cov +envlist = py36, py37, py38, lint, pylint, typing, cov skip_missing_interpreters = True [testenv]