Update hacking and fix pep8

Change-Id: I6dbe75895d33f80faf8fa56bf6d342dcaf81e587
Signed-off-by: Trinh Nguyen <dangtrinhnt@gmail.com>
Co-Authored-By: ZhijunWei <wzj334965317@outlook.com>
This commit is contained in:
Trinh Nguyen 2019-01-28 17:19:07 +09:00
parent b91394e2a9
commit 6dabd5cd9e
8 changed files with 35 additions and 36 deletions

View File

@ -32,6 +32,8 @@ import warnings
import openstackdocstheme
from searchlight.version import version_info
html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]
html_theme_options = {
@ -72,7 +74,6 @@ copyright = u'2015-present, OpenStack Foundation'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from searchlight.version import version_info
# The full version, including alpha/beta/rc tags.
release = version_info.release_string()
# The short X.Y version.

View File

@ -27,7 +27,7 @@ fixtures==3.0.0
flake8==2.2.4
futurist==1.6.0
greenlet==0.4.10
hacking==0.10.0
hacking==1.1.0
httplib2==0.12.0
idna==2.6
imagesize==1.0.0

View File

@ -21,13 +21,24 @@
Searchlight API Server
"""
import eventlet
import os
import sys
import eventlet
from oslo_config import cfg
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_utils import encodeutils
import osprofiler.notifier
import osprofiler.web
from searchlight.common import config
from searchlight.common import exception
from searchlight.common import utils
from searchlight.common import wsgi
from searchlight import notifier
from searchlight import service_policies
from searchlight import version
# Monkey patch socket, time, select, threads
# NOTE(sjmc7): to workaround issue with 2.7.12-1ubuntu0~16.04.3 and
@ -46,19 +57,6 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
if os.path.exists(os.path.join(possible_topdir, 'searchlight', '__init__.py')):
sys.path.insert(0, possible_topdir)
from oslo_config import cfg
from oslo_log import log as logging
import osprofiler.notifier
import osprofiler.web
from searchlight.common import config
from searchlight.common import exception
from searchlight.common import utils
from searchlight.common import wsgi
from searchlight import notifier
from searchlight import service_policies
from searchlight import version
CONF = cfg.CONF
CONF.import_group("profiler", "searchlight.common.wsgi")
CONF.import_group("api", "searchlight.common.wsgi")

View File

@ -31,6 +31,13 @@ import sys
import tempfile
import time
from oslo_config import cfg
from oslo_utils import units
from six.moves import range
from searchlight.common import config
from searchlight.i18n import _
# If ../searchlight/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
@ -39,14 +46,6 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
if os.path.exists(os.path.join(possible_topdir, 'searchlight', '__init__.py')):
sys.path.insert(0, possible_topdir)
from oslo_config import cfg
from oslo_utils import units
# NOTE(jokke): simplified transition to py3, behaves like py2 xrange
from six.moves import range
from searchlight.common import config
from searchlight.i18n import _
CONF = cfg.CONF
ALL_COMMANDS = ['start', 'status', 'stop', 'shutdown', 'restart',

View File

@ -13,7 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_i18n import * # noqa
from oslo_i18n import get_available_languages # noqa
from oslo_i18n import translate # noqa
from oslo_i18n import TranslatorFactory # noqa
_translators = TranslatorFactory(domain='searchlight')

View File

@ -14,9 +14,13 @@
# limitations under the License.
import os
import simplejson as json
from glanceclient.v2 import client as glance
from keystoneauth1 import session
from keystoneclient.auth.identity import v2
import novaclient.client
IMAGES_FILE = "searchlight/tests/functional/data/load/images.json"
METADEFS_FILE = "searchlight/tests/functional/data/load/metadefs.json"
IMAGE_MEMBERS_FILE = \
@ -26,12 +30,6 @@ FLAVORS_FILE = "searchlight/tests/functional/data/load/flavors.json"
SERVER_GROUP_FILE = \
"searchlight/tests/functional/data/load/server_groups.json"
from glanceclient.v2 import client as glance
from keystoneauth1 import session
from keystoneclient.auth.identity import v2
import novaclient.client
_session = None

View File

@ -3,7 +3,8 @@
# process, which may cause wedges in the gate later.
# Hacking already pins down pep8, pyflakes and flake8
hacking<0.11,>=0.10.0
#hacking<0.11,>=0.10.0
hacking>=1.1.0,<1.2.0 # Apache-2.0
# For translations processing
Babel!=2.4.0,>=2.3.4 # BSD

View File

@ -117,9 +117,9 @@ class InstallVenv(object):
self.pip_install('setuptools')
self.pip_install('pbr')
upper_constraints = (
os.environ.get("UPPER_CONSTRAINTS_FILE")
or ("https://git.openstack.org/cgit/openstack/requirements"
"/plain/upper-constraints.txt"))
os.environ.get("UPPER_CONSTRAINTS_FILE") or
("https://git.openstack.org/cgit/openstack/requirements"
"/plain/upper-constraints.txt"))
self.pip_install('-c', upper_constraints,
'-r', self.requirements,
'-r', self.test_requirements)