Skip to content

Commit b0d6f8e

Browse files
committed
Run lint failure file through pre-commit
1 parent b06d298 commit b0d6f8e

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

readthedocs/config/config.py

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
# pylint: disable=too-many-lines
23

34
"""Build configuration for rtd."""
@@ -36,7 +37,6 @@
3637
validate_string,
3738
)
3839

39-
4040
__all__ = (
4141
'ALL',
4242
'load',
@@ -64,14 +64,16 @@
6464
INVALID_KEYS_COMBINATION = 'invalid-keys-combination'
6565
INVALID_KEY = 'invalid-key'
6666

67-
DOCKER_DEFAULT_IMAGE = getattr(settings, 'DOCKER_DEFAULT_IMAGE', 'readthedocs/build')
67+
DOCKER_DEFAULT_IMAGE = getattr(
68+
settings, 'DOCKER_DEFAULT_IMAGE', 'readthedocs/build'
69+
)
6870
DOCKER_DEFAULT_VERSION = getattr(settings, 'DOCKER_DEFAULT_VERSION', '2.0')
6971
# These map to corresponding settings in the .org,
7072
# so they haven't been renamed.
7173
DOCKER_IMAGE = getattr(
7274
settings,
7375
'DOCKER_IMAGE',
74-
'{}:{}'.format(DOCKER_DEFAULT_IMAGE, DOCKER_DEFAULT_VERSION)
76+
'{}:{}'.format(DOCKER_DEFAULT_IMAGE, DOCKER_DEFAULT_VERSION),
7577
)
7678
DOCKER_IMAGE_SETTINGS = getattr(settings, 'DOCKER_IMAGE_SETTINGS', {})
7779

@@ -243,9 +245,7 @@ def python_full_version(self):
243245
# Get the highest version of the major series version if user only
244246
# gave us a version of '2', or '3'
245247
ver = max(
246-
v
247-
for v in self.get_valid_python_versions()
248-
if v < ver + 1
248+
v for v in self.get_valid_python_versions() if v < ver + 1
249249
)
250250
return ver
251251

@@ -275,7 +275,6 @@ def get_valid_python_versions_for_image(self, build_image):
275275
Returns supported versions for the ``DOCKER_DEFAULT_VERSION`` if not
276276
``build_image`` found.
277277
"""
278-
279278
if build_image not in DOCKER_IMAGE_SETTINGS:
280279
build_image = '{}:{}'.format(
281280
DOCKER_DEFAULT_IMAGE,
@@ -320,7 +319,9 @@ def get_valid_python_versions(self):
320319
except (KeyError, TypeError):
321320
versions = set()
322321
for _, options in DOCKER_IMAGE_SETTINGS.items():
323-
versions = versions.union(options['python']['supported_versions'])
322+
versions = versions.union(
323+
options['python']['supported_versions']
324+
)
324325
return versions
325326

326327
def get_valid_formats(self): # noqa
@@ -510,7 +511,8 @@ def validate_requirements_file(self):
510511
return None
511512
with self.catch_validation_error('requirements_file'):
512513
requirements_file = validate_file(
513-
requirements_file, self.base_path
514+
requirements_file,
515+
self.base_path,
514516
)
515517
return requirements_file
516518

@@ -546,23 +548,23 @@ def python(self):
546548
python_install.append(
547549
PythonInstallRequirements(
548550
requirements=requirements,
549-
)
551+
),
550552
)
551553
if python['install_with_pip']:
552554
python_install.append(
553555
PythonInstall(
554556
path=self.base_path,
555557
method=PIP,
556558
extra_requirements=python['extra_requirements'],
557-
)
559+
),
558560
)
559561
elif python['install_with_setup']:
560562
python_install.append(
561563
PythonInstall(
562564
path=self.base_path,
563565
method=SETUPTOOLS,
564566
extra_requirements=[],
565-
)
567+
),
566568
)
567569

568570
return Python(
@@ -785,30 +787,30 @@ def validate_python_install(self, index):
785787
with self.catch_validation_error(requirements_key):
786788
requirements = validate_file(
787789
self.pop_config(requirements_key),
788-
self.base_path
790+
self.base_path,
789791
)
790792
python_install['requirements'] = requirements
791793
elif 'path' in raw_install:
792794
path_key = key + '.path'
793795
with self.catch_validation_error(path_key):
794796
path = validate_directory(
795797
self.pop_config(path_key),
796-
self.base_path
798+
self.base_path,
797799
)
798800
python_install['path'] = path
799801

800802
method_key = key + '.method'
801803
with self.catch_validation_error(method_key):
802804
method = validate_choice(
803805
self.pop_config(method_key, PIP),
804-
self.valid_install_method
806+
self.valid_install_method,
805807
)
806808
python_install['method'] = method
807809

808810
extra_req_key = key + '.extra_requirements'
809811
with self.catch_validation_error(extra_req_key):
810812
extra_requirements = validate_list(
811-
self.pop_config(extra_req_key, [])
813+
self.pop_config(extra_req_key, []),
812814
)
813815
if extra_requirements and python_install['method'] != PIP:
814816
self.error(
@@ -1060,13 +1062,9 @@ def python(self):
10601062
python = self._config['python']
10611063
for install in python['install']:
10621064
if 'requirements' in install:
1063-
python_install.append(
1064-
PythonInstallRequirements(**install)
1065-
)
1065+
python_install.append(PythonInstallRequirements(**install),)
10661066
elif 'path' in install:
1067-
python_install.append(
1068-
PythonInstall(**install)
1069-
)
1067+
python_install.append(PythonInstall(**install),)
10701068
return Python(
10711069
version=python['version'],
10721070
install=python_install,

0 commit comments

Comments
 (0)