Commit 6daf9df0 by Tyler Hallada

Disable pylint errors in cms/envs/

parent e0ef561c
...@@ -7,6 +7,10 @@ so that we can run the lettuce acceptance tests. ...@@ -7,6 +7,10 @@ so that we can run the lettuce acceptance tests.
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=wildcard-import, unused-wildcard-import
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order, wrong-import-position
from .test import * from .test import *
from lms.envs.sauce import * from lms.envs.sauce import *
...@@ -27,6 +31,7 @@ import os ...@@ -27,6 +31,7 @@ import os
def seed(): def seed():
return os.getppid() return os.getppid()
# Silence noisy logs # Silence noisy logs
LOG_OVERRIDES = [ LOG_OVERRIDES = [
('track.middleware', logging.CRITICAL), ('track.middleware', logging.CRITICAL),
...@@ -132,7 +137,7 @@ SELENIUM_GRID = { ...@@ -132,7 +137,7 @@ SELENIUM_GRID = {
##################################################################### #####################################################################
# Lastly, see if the developer has any local overrides. # Lastly, see if the developer has any local overrides.
try: try:
from .private import * # pylint: disable=import-error from .private import *
except ImportError: except ImportError:
pass pass
......
...@@ -3,6 +3,10 @@ This config file extends the test environment configuration ...@@ -3,6 +3,10 @@ This config file extends the test environment configuration
so that we can run the lettuce acceptance tests. so that we can run the lettuce acceptance tests.
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-position
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=wildcard-import, unused-wildcard-import
......
""" """
This is the settings file used during execution of the analytics-exporter job. This is the settings file used during execution of the analytics-exporter job.
""" """
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .aws import * from .aws import *
ENABLE_COMPREHENSIVE_THEMING = False ENABLE_COMPREHENSIVE_THEMING = False
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
This is the default template for our main set of AWS servers. This is the default template for our main set of AWS servers.
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=wildcard-import, unused-wildcard-import
# Pylint gets confused by path.py instances, which report themselves as class
# objects. As a result, pylint applies the wrong regex in validating names,
# and throws spurious errors. Therefore, we disable invalid-name checking.
# pylint: disable=invalid-name
import json import json
from .common import * from .common import *
......
...@@ -10,6 +10,14 @@ support both generating static assets to a directory and also serving static ...@@ -10,6 +10,14 @@ support both generating static assets to a directory and also serving static
from the same directory. from the same directory.
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order, wrong-import-position
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
import os import os
from path import Path as path from path import Path as path
...@@ -24,7 +32,7 @@ from openedx.core.release import RELEASE_LINE ...@@ -24,7 +32,7 @@ from openedx.core.release import RELEASE_LINE
os.environ['SERVICE_VARIANT'] = 'bok_choy_docker' if 'BOK_CHOY_HOSTNAME' in os.environ else 'bok_choy' os.environ['SERVICE_VARIANT'] = 'bok_choy_docker' if 'BOK_CHOY_HOSTNAME' in os.environ else 'bok_choy'
os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname()
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import from .aws import *
######################### Testing overrides #################################### ######################### Testing overrides ####################################
...@@ -147,6 +155,6 @@ if RELEASE_LINE == "master": ...@@ -147,6 +155,6 @@ if RELEASE_LINE == "master":
##################################################################### #####################################################################
# Lastly, see if the developer has any local overrides. # Lastly, see if the developer has any local overrides.
try: try:
from .private import * # pylint: disable=import-error from .private import *
except ImportError: except ImportError:
pass pass
...@@ -3,8 +3,12 @@ ...@@ -3,8 +3,12 @@
Settings for Bok Choy tests that are used when running Studio in Docker-based devstack. Settings for Bok Choy tests that are used when running Studio in Docker-based devstack.
""" """
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from .bok_choy import * # pylint: disable=wildcard-import from .bok_choy import *
CMS_BASE = '{}:{}'.format(os.environ['BOK_CHOY_HOSTNAME'], os.environ['BOK_CHOY_CMS_PORT']) CMS_BASE = '{}:{}'.format(os.environ['BOK_CHOY_HOSTNAME'], os.environ['BOK_CHOY_CMS_PORT'])
LMS_BASE = '{}:{}'.format(os.environ['BOK_CHOY_HOSTNAME'], os.environ['BOK_CHOY_LMS_PORT']) LMS_BASE = '{}:{}'.format(os.environ['BOK_CHOY_HOSTNAME'], os.environ['BOK_CHOY_LMS_PORT'])
......
...@@ -35,6 +35,10 @@ When refering to XBlocks, we use the entry-point name. For example, ...@@ -35,6 +35,10 @@ When refering to XBlocks, we use the entry-point name. For example,
| ) | )
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=unused-import # pylint: disable=unused-import
......
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
A new cms ENV configuration to use a slow upload file handler to help test A new cms ENV configuration to use a slow upload file handler to help test
progress bars in uploads progress bars in uploads
""" """
# pylint: disable=unused-wildcard-import
from .dev import * # pylint: disable=wildcard-import # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .dev import *
FILE_UPLOAD_HANDLERS = [ FILE_UPLOAD_HANDLERS = [
'contentstore.debug_file_uploader.DebugFileUploader', 'contentstore.debug_file_uploader.DebugFileUploader',
......
""" """
This config file runs the simplest dev environment""" This config file runs the simplest dev environment.
"""
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order, wrong-import-position
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
...@@ -176,7 +181,7 @@ CMS_SEGMENT_KEY = os.environ.get('SEGMENT_KEY') ...@@ -176,7 +181,7 @@ CMS_SEGMENT_KEY = os.environ.get('SEGMENT_KEY')
##################################################################### #####################################################################
# Lastly, see if the developer has any local overrides. # Lastly, see if the developer has any local overrides.
try: try:
from .private import * # pylint: disable=import-error from .private import *
except ImportError: except ImportError:
pass pass
......
...@@ -2,9 +2,17 @@ ...@@ -2,9 +2,17 @@
Specific overrides to the base prod settings to make development easier. Specific overrides to the base prod settings to make development easier.
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order, wrong-import-position
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from os.path import abspath, dirname, join from os.path import abspath, dirname, join
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import from .aws import *
# Don't use S3 in devstack, fall back to filesystem # Don't use S3 in devstack, fall back to filesystem
del DEFAULT_FILE_STORAGE del DEFAULT_FILE_STORAGE
......
""" Overrides for Docker-based devstack. """ """
Overrides for Docker-based devstack.
"""
from .devstack import * # pylint: disable=wildcard-import, unused-wildcard-import # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .devstack import *
# Docker does not support the syslog socket at /dev/log. Rely on the console. # Docker does not support the syslog socket at /dev/log. Rely on the console.
LOGGING['handlers']['local'] = LOGGING['handlers']['tracking'] = { LOGGING['handlers']['local'] = LOGGING['handlers']['tracking'] = {
......
...@@ -18,14 +18,18 @@ as they are for non-optimized devstack. Instead, update_assets must be ...@@ -18,14 +18,18 @@ as they are for non-optimized devstack. Instead, update_assets must be
invoked each time that changes have been made. invoked each time that changes have been made.
""" """
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
import os import os
########################## Devstack settings ################################### ########################## Devstack settings ###################################
if 'BOK_CHOY_HOSTNAME' in os.environ: if 'BOK_CHOY_HOSTNAME' in os.environ:
from .devstack_docker import * # pylint: disable=wildcard-import, unused-wildcard-import from .devstack_docker import *
else: else:
from .devstack import * # pylint: disable=wildcard-import, unused-wildcard-import from .devstack import *
TEST_ROOT = REPO_ROOT / "test_root" TEST_ROOT = REPO_ROOT / "test_root"
......
...@@ -11,11 +11,12 @@ In two separate processes on devstack: ...@@ -11,11 +11,12 @@ In two separate processes on devstack:
./manage.py cms celery worker --settings=devstack_with_worker ./manage.py cms celery worker --settings=devstack_with_worker
""" """
import os
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=wildcard-import, unused-wildcard-import
import os
if 'BOK_CHOY_HOSTNAME' in os.environ: if 'BOK_CHOY_HOSTNAME' in os.environ:
from cms.envs.devstack_docker import * from cms.envs.devstack_docker import *
else: else:
......
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
Settings for OpenStack deployments. Settings for OpenStack deployments.
""" """
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
# We import the aws settings because that's currently where the base settings are stored for all deployments. # We import the aws settings because that's currently where the base settings are stored for all deployments.
# TODO - fix this when aws.py is split/renamed. # TODO - fix this when aws.py is split/renamed.
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import from .aws import *
SWIFT_AUTH_URL = AUTH_TOKENS.get('SWIFT_AUTH_URL') SWIFT_AUTH_URL = AUTH_TOKENS.get('SWIFT_AUTH_URL')
SWIFT_AUTH_VERSION = AUTH_TOKENS.get('SWIFT_AUTH_VERSION', 1) SWIFT_AUTH_VERSION = AUTH_TOKENS.get('SWIFT_AUTH_VERSION', 1)
......
...@@ -9,15 +9,14 @@ sessions. Assumes structure: ...@@ -9,15 +9,14 @@ sessions. Assumes structure:
/log # Where we're going to write log files /log # Where we're going to write log files
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import # pylint: disable=wildcard-import, unused-wildcard-import
# Pylint gets confused by path.py instances, which report themselves as class
# objects. As a result, pylint applies the wrong regex in validating names,
# and throws spurious errors. Therefore, we disable invalid-name checking.
# pylint: disable=invalid-name
from .common import * from .common import *
import os import os
from path import Path as path from path import Path as path
...@@ -71,7 +70,8 @@ COMMON_TEST_DATA_ROOT = COMMON_ROOT / "test" / "data" ...@@ -71,7 +70,8 @@ COMMON_TEST_DATA_ROOT = COMMON_ROOT / "test" / "data"
FEATURES['ENABLE_EXPORT_GIT'] = True FEATURES['ENABLE_EXPORT_GIT'] = True
GIT_REPO_EXPORT_DIR = TEST_ROOT / "export_course_repos" GIT_REPO_EXPORT_DIR = TEST_ROOT / "export_course_repos"
# TODO (cpennington): We need to figure out how envs/test.py can inject things into common.py so that we don't have to repeat this sort of thing # TODO (cpennington): We need to figure out how envs/test.py can inject things into common.py so that we don't have to
# repeat this sort of thing
STATICFILES_DIRS = [ STATICFILES_DIRS = [
COMMON_ROOT / "static", COMMON_ROOT / "static",
PROJECT_ROOT / "static", PROJECT_ROOT / "static",
......
...@@ -10,8 +10,16 @@ support both generating static assets to a directory and also serving static ...@@ -10,8 +10,16 @@ support both generating static assets to a directory and also serving static
from the same directory. from the same directory.
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
# Start with the common settings # Start with the common settings
from .common import * # pylint: disable=wildcard-import, unused-wildcard-import from .common import *
from openedx.core.lib.derived import derive_settings from openedx.core.lib.derived import derive_settings
# Use an in-memory database since this settings file is only used for updating assets # Use an in-memory database since this settings file is only used for updating assets
......
...@@ -10,6 +10,10 @@ defined in the environment: ...@@ -10,6 +10,10 @@ defined in the environment:
""" """
# For Django settings files, the order of imports matters,
# because each import can override variables in previous imports.
# pylint: disable=wrong-import-order, ungrouped-imports
# We intentionally define lots of variables that aren't used, and # We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files # want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import, undefined-variable, used-before-assignment # pylint: disable=wildcard-import, unused-wildcard-import, undefined-variable, used-before-assignment
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment