Add pyupgrade (in pre-commit and CI) (#33688)

* Add pyupgrade (in pre-commit and CI)

* Fix leftover results of pyupgrade

* Ensure we run for Python 3.7 on pyupgrade
This commit is contained in:
Franck Nijhof
2020-04-05 12:49:57 +02:00
committed by GitHub
parent 5bf7e0fcc0
commit f38011560f
9 changed files with 18 additions and 9 deletions

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Home-Assistant documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 28 13:13:10 2016.
@@ -26,7 +25,7 @@ from homeassistant.const import __short_version__, __version__
PROJECT_NAME = 'Home Assistant'
PROJECT_PACKAGE_NAME = 'homeassistant'
PROJECT_AUTHOR = 'The Home Assistant Authors'
PROJECT_COPYRIGHT = ' 2013-2020, {}'.format(PROJECT_AUTHOR)
PROJECT_COPYRIGHT = f' 2013-2020, {PROJECT_AUTHOR}'
PROJECT_LONG_DESCRIPTION = ('Home Assistant is an open-source '
'home automation platform running on Python 3. '
'Track and control all devices at home and '
@@ -37,7 +36,7 @@ PROJECT_GITHUB_REPOSITORY = 'home-assistant'
GITHUB_PATH = '{}/{}'.format(
PROJECT_GITHUB_USERNAME, PROJECT_GITHUB_REPOSITORY)
GITHUB_URL = 'https://github.com/{}'.format(GITHUB_PATH)
GITHUB_URL = f'https://github.com/{GITHUB_PATH}'
sys.path.insert(0, os.path.abspath('_ext'))
@@ -132,7 +131,7 @@ def linkcode_resolve(domain, info):
fn = fn[index:]
return '{}/blob/{}/{}{}'.format(GITHUB_URL, code_branch, fn, linespec)
return f'{GITHUB_URL}/blob/{code_branch}/{fn}{linespec}'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.