Skip to content

Remove excluding files on search. #5246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 7, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 20 additions & 22 deletions readthedocs/config/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that you have an old pre-commit settings.

# pylint: disable=too-many-lines

"""Build configuration for rtd."""
Expand Down Expand Up @@ -36,7 +37,6 @@
validate_string,
)


__all__ = (
'ALL',
'load',
Expand Down Expand Up @@ -64,14 +64,16 @@
INVALID_KEYS_COMBINATION = 'invalid-keys-combination'
INVALID_KEY = 'invalid-key'

DOCKER_DEFAULT_IMAGE = getattr(settings, 'DOCKER_DEFAULT_IMAGE', 'readthedocs/build')
DOCKER_DEFAULT_IMAGE = getattr(
settings, 'DOCKER_DEFAULT_IMAGE', 'readthedocs/build'
)
DOCKER_DEFAULT_VERSION = getattr(settings, 'DOCKER_DEFAULT_VERSION', '2.0')
# These map to corresponding settings in the .org,
# so they haven't been renamed.
DOCKER_IMAGE = getattr(
settings,
'DOCKER_IMAGE',
'{}:{}'.format(DOCKER_DEFAULT_IMAGE, DOCKER_DEFAULT_VERSION)
'{}:{}'.format(DOCKER_DEFAULT_IMAGE, DOCKER_DEFAULT_VERSION),
)
DOCKER_IMAGE_SETTINGS = getattr(settings, 'DOCKER_IMAGE_SETTINGS', {})

Expand Down Expand Up @@ -243,9 +245,7 @@ def python_full_version(self):
# Get the highest version of the major series version if user only
# gave us a version of '2', or '3'
ver = max(
v
for v in self.get_valid_python_versions()
if v < ver + 1
v for v in self.get_valid_python_versions() if v < ver + 1
)
return ver

Expand Down Expand Up @@ -275,7 +275,6 @@ def get_valid_python_versions_for_image(self, build_image):
Returns supported versions for the ``DOCKER_DEFAULT_VERSION`` if not
``build_image`` found.
"""

if build_image not in DOCKER_IMAGE_SETTINGS:
build_image = '{}:{}'.format(
DOCKER_DEFAULT_IMAGE,
Expand Down Expand Up @@ -320,7 +319,9 @@ def get_valid_python_versions(self):
except (KeyError, TypeError):
versions = set()
for _, options in DOCKER_IMAGE_SETTINGS.items():
versions = versions.union(options['python']['supported_versions'])
versions = versions.union(
options['python']['supported_versions']
)
return versions

def get_valid_formats(self): # noqa
Expand Down Expand Up @@ -510,7 +511,8 @@ def validate_requirements_file(self):
return None
with self.catch_validation_error('requirements_file'):
requirements_file = validate_file(
requirements_file, self.base_path
requirements_file,
self.base_path,
)
return requirements_file

Expand Down Expand Up @@ -546,23 +548,23 @@ def python(self):
python_install.append(
PythonInstallRequirements(
requirements=requirements,
)
),
)
if python['install_with_pip']:
python_install.append(
PythonInstall(
path=self.base_path,
method=PIP,
extra_requirements=python['extra_requirements'],
)
),
)
elif python['install_with_setup']:
python_install.append(
PythonInstall(
path=self.base_path,
method=SETUPTOOLS,
extra_requirements=[],
)
),
)

return Python(
Expand Down Expand Up @@ -785,30 +787,30 @@ def validate_python_install(self, index):
with self.catch_validation_error(requirements_key):
requirements = validate_file(
self.pop_config(requirements_key),
self.base_path
self.base_path,
)
python_install['requirements'] = requirements
elif 'path' in raw_install:
path_key = key + '.path'
with self.catch_validation_error(path_key):
path = validate_directory(
self.pop_config(path_key),
self.base_path
self.base_path,
)
python_install['path'] = path

method_key = key + '.method'
with self.catch_validation_error(method_key):
method = validate_choice(
self.pop_config(method_key, PIP),
self.valid_install_method
self.valid_install_method,
)
python_install['method'] = method

extra_req_key = key + '.extra_requirements'
with self.catch_validation_error(extra_req_key):
extra_requirements = validate_list(
self.pop_config(extra_req_key, [])
self.pop_config(extra_req_key, []),
)
if extra_requirements and python_install['method'] != PIP:
self.error(
Expand Down Expand Up @@ -1060,13 +1062,9 @@ def python(self):
python = self._config['python']
for install in python['install']:
if 'requirements' in install:
python_install.append(
PythonInstallRequirements(**install)
)
python_install.append(PythonInstallRequirements(**install),)
elif 'path' in install:
python_install.append(
PythonInstall(**install)
)
python_install.append(PythonInstall(**install),)
return Python(
version=python['version'],
install=python_install,
Expand Down