From 25b6706f503b5377c4eccba74fc7fcdc07a82bfb Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sun, 23 Dec 2018 02:31:32 +0900 Subject: [PATCH] Allow to run pep8/docs tox env with horizon plugins As of now, when horizon plugins are configured in the horizon repo, pep8 and docs tox env cannot run. This is because openstack_dashboard.settings tries to load horizon plugins but horizon plugins are not installed in tox env by default and the jobs will fail as a result. This commit changes to use openstack_dashboard.test.settings as DJANGO_SETTINGS_MODULE for these tox environments by default. Change-Id: I6a9d0c74271cc4addd8a0964b5955d7d3b6d8267 --- doc/source/conf.py | 3 ++- tox.ini | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index d3b84fd21f..7487c6ac71 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -45,7 +45,8 @@ ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) sys.path.insert(0, ROOT) # This is required for ReadTheDocs.org, but isn't a bad idea anyway. -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'openstack_dashboard.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', + 'openstack_dashboard.test.settings') django.setup() diff --git a/tox.ini b/tox.ini index 7def53269d..9ca96c3ff0 100644 --- a/tox.ini +++ b/tox.ini @@ -56,6 +56,9 @@ basepython = python3 deps = {[testenv]deps} -r{toxinidir}/doc/requirements.txt +setenv = + {[testenv]setenv} + DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings commands = flake8 {posargs} {envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only