Update from global requirements

Fix lots of pep8 issues caused by new version of hacking.

Change-Id: I70c1bef9e826a7c74ef87c052fc248e858ea0c73
This commit is contained in:
Ilya Shakhat 2014-12-22 18:49:58 +03:00
parent aa4413376f
commit 0d9f72e52f
13 changed files with 188 additions and 172 deletions

View File

@ -2,14 +2,14 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
pbr>=0.6,!=0.7,<0.10.3 pbr>=0.6,!=0.7,<1.0
Babel>=1.3 Babel>=1.3
Flask>=0.10,<1.0 Flask>=0.10,<1.0
iso8601>=0.1.9 iso8601>=0.1.9
oslo.config>=1.4.0 # Apache-2.0 oslo.config>=1.4.0 # Apache-2.0
oslo.i18n>=1.0.0 # Apache-2.0 oslo.i18n>=1.0.0 # Apache-2.0
oslo.serialization>=1.0.0 # Apache-2.0 oslo.serialization>=1.0.0 # Apache-2.0
oslo.utils>=1.0.0 # Apache-2.0 oslo.utils>=1.1.0 # Apache-2.0
paramiko>=1.13.0 paramiko>=1.13.0
psutil>=1.1.1,<2.0.0 psutil>=1.1.1,<2.0.0
PyGithub PyGithub

View File

@ -9,7 +9,7 @@ iso8601>=0.1.9
oslo.config>=1.4.0 # Apache-2.0 oslo.config>=1.4.0 # Apache-2.0
oslo.i18n>=1.0.0 # Apache-2.0 oslo.i18n>=1.0.0 # Apache-2.0
oslo.serialization>=1.0.0 # Apache-2.0 oslo.serialization>=1.0.0 # Apache-2.0
oslo.utils>=1.0.0 # Apache-2.0 oslo.utils>=1.1.0 # Apache-2.0
paramiko>=1.13.0 paramiko>=1.13.0
psutil>=1.1.1,<2.0.0 psutil>=1.1.1,<2.0.0
PyGithub PyGithub

View File

@ -237,9 +237,9 @@ def make_link(title, uri=None, options=None):
'metric') 'metric')
param_values = {} param_values = {}
for param_name in param_names: for param_name in param_names:
v = parameters.get_parameter({}, param_name) value = parameters.get_parameter({}, param_name)
if v: if value:
param_values[param_name] = ','.join(v) param_values[param_name] = ','.join(value)
if options: if options:
param_values.update(options) param_values.update(options)
if param_values: if param_values:

View File

@ -274,7 +274,7 @@ def get_companies_json(record_ids, **kwargs):
memory_storage = vault.get_memory_storage() memory_storage = vault.get_memory_storage()
companies = set(company companies = set(company
for company in memory_storage.get_index_keys_by_record_ids( for company in memory_storage.get_index_keys_by_record_ids(
'company_name', record_ids)) 'company_name', record_ids))
if kwargs['_params']['company']: if kwargs['_params']['company']:
companies.add(memory_storage.get_original_company_name( companies.add(memory_storage.get_original_company_name(

View File

@ -16,10 +16,10 @@
import collections import collections
import hashlib import hashlib
import json import json
import re
from github import MainClass from github import MainClass
from oslo.config import cfg from oslo.config import cfg
import re
import six import six
from stackalytics.openstack.common import log as logging from stackalytics.openstack.common import log as logging

View File

@ -14,11 +14,11 @@
# limitations under the License. # limitations under the License.
import pickle import pickle
import re
import sys import sys
import memcache import memcache
from oslo.config import cfg from oslo.config import cfg
import re
import six import six
from six.moves.urllib import parse from six.moves.urllib import parse

View File

@ -25,10 +25,10 @@ from stackalytics.processor import utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
NAME_AND_DATE_PATTERN = r'<h3>(?P<member_name>[^<]*)[\s\S]*?' \ NAME_AND_DATE_PATTERN = (r'<h3>(?P<member_name>[^<]*)[\s\S]*?'
r'<div class="span-7 last">(?P<date_joined>[^<]*)' r'<div class="span-7 last">(?P<date_joined>[^<]*)')
COMPANY_PATTERN = r'<strong>Date\sJoined[\s\S]*?<b>(?P<company_draft>[^<]*)' \ COMPANY_PATTERN = (r'<strong>Date\sJoined[\s\S]*?<b>(?P<company_draft>[^<]*)'
r'[\s\S]*?From\s(?P<date_from>[\s\S]*?)\(Current\)' r'[\s\S]*?From\s(?P<date_from>[\s\S]*?)\(Current\)')
GARBAGE_PATTERN = r'[/\\~%^\*_]+' GARBAGE_PATTERN = r'[/\\~%^\*_]+'

View File

@ -3,7 +3,7 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
# Hacking already pins down pep8, pyflakes and flake8 # Hacking already pins down pep8, pyflakes and flake8
hacking>=0.8.0,<0.9 hacking>=0.9.4,<0.10
coverage>=3.6 coverage>=3.6
discover discover
fixtures>=0.3.14 fixtures>=0.3.14
@ -13,4 +13,4 @@ python-subunit
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
sphinxcontrib-httpdomain sphinxcontrib-httpdomain
testrepository>=0.0.17 testrepository>=0.0.17
testtools>=0.9.32 testtools>=0.9.32,<0.9.35

View File

@ -20,17 +20,18 @@ class TestAPICompanies(test_api.TestAPI):
def test_get_companies(self): def test_get_companies(self):
with test_api.make_runtime_storage( with test_api.make_runtime_storage(
{'repos': [ {
{'module': 'nova', 'project_type': 'openstack', 'repos': [
'organization': 'openstack', {'module': 'nova', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/nova.git'}, 'organization': 'openstack',
{'module': 'glance', 'project_type': 'openstack', 'uri': 'git://git.openstack.org/openstack/nova.git'},
'organization': 'openstack', {'module': 'glance', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/glance.git'}], 'organization': 'openstack',
'uri': 'git://git.openstack.org/openstack/glance.git'}
],
'project_types': [ 'project_types': [
{'id': 'openstack', 'title': 'OpenStack', {'id': 'openstack', 'title': 'OpenStack',
'modules': ['nova', 'glance']} 'modules': ['nova', 'glance']}],
],
'releases': [{'release_name': 'prehistory', 'releases': [{'release_name': 'prehistory',
'end_date': 1234567890}, 'end_date': 1234567890},
{'release_name': 'icehouse', {'release_name': 'icehouse',
@ -75,26 +76,28 @@ class TestAPICompanies(test_api.TestAPI):
def test_get_company(self): def test_get_company(self):
with test_api.make_runtime_storage( with test_api.make_runtime_storage(
{'repos': [ {
{'module': 'nova', 'project_type': 'openstack', 'repos': [
'organization': 'openstack', {'module': 'nova', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/nova.git'}, 'organization': 'openstack',
{'module': 'glance', 'project_type': 'openstack', 'uri': 'git://git.openstack.org/openstack/nova.git'},
'organization': 'openstack', {'module': 'glance', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/glance.git'}], 'organization': 'openstack',
'module_groups': { 'uri': 'git://git.openstack.org/openstack/glance.git'}
'nova': test_api.make_module('nova'), ],
'glance': test_api.make_module('glance'), 'module_groups': {
}, 'nova': test_api.make_module('nova'),
'releases': [{'release_name': 'prehistory', 'glance': test_api.make_module('glance'),
'end_date': 1234567890}, },
{'release_name': 'icehouse', 'releases': [{'release_name': 'prehistory',
'end_date': 1234567890}], 'end_date': 1234567890},
'project_types': [ {'release_name': 'icehouse',
{'id': 'all', 'title': 'All', 'end_date': 1234567890}],
'modules': ['nova', 'glance', 'nova-cli']}, 'project_types': [
{'id': 'openstack', 'title': 'OpenStack', {'id': 'all', 'title': 'All',
'modules': ['nova', 'glance']}]}, 'modules': ['nova', 'glance', 'nova-cli']},
{'id': 'openstack', 'title': 'OpenStack',
'modules': ['nova', 'glance']}]},
test_api.make_records(record_type=['commit'], test_api.make_records(record_type=['commit'],
loc=[10, 20, 30], loc=[10, 20, 30],
module=['glance'], module=['glance'],

View File

@ -20,29 +20,31 @@ class TestAPIModules(test_api.TestAPI):
def test_get_modules(self): def test_get_modules(self):
with test_api.make_runtime_storage( with test_api.make_runtime_storage(
{'repos': [ {
{'module': 'nova', 'organization': 'openstack', 'repos': [
'uri': 'git://git.openstack.org/openstack/nova.git'}, {'module': 'nova', 'organization': 'openstack',
{'module': 'glance', 'organization': 'openstack', 'uri': 'git://git.openstack.org/openstack/nova.git'},
'uri': 'git://git.openstack.org/openstack/glance.git'}], {'module': 'glance', 'organization': 'openstack',
'module_groups': { 'uri': 'git://git.openstack.org/openstack/glance.git'}
'nova-group': {'id': 'nova-group', ],
'module_group_name': 'nova-group', 'module_groups': {
'modules': ['nova', 'nova-cli'], 'nova-group': {'id': 'nova-group',
'tag': 'group'}, 'module_group_name': 'nova-group',
'nova': test_api.make_module('nova'), 'modules': ['nova', 'nova-cli'],
'nova-cli': test_api.make_module('nova-cli'), 'tag': 'group'},
'glance': test_api.make_module('glance'), 'nova': test_api.make_module('nova'),
}, 'nova-cli': test_api.make_module('nova-cli'),
'releases': [{'release_name': 'prehistory', 'glance': test_api.make_module('glance'),
'end_date': 1234567890}, },
{'release_name': 'icehouse', 'releases': [
'end_date': 1234567890}], {'release_name': 'prehistory', 'end_date': 1234567890},
'project_types': [ {'release_name': 'icehouse', 'end_date': 1234567890}],
{'id': 'all', 'title': 'All', 'project_types': [{'id': 'all', 'title': 'All',
'modules': ['nova', 'glance', 'nova-cli']}, 'modules': ['nova', 'glance',
{'id': 'integrated', 'title': 'Integrated', 'nova-cli']},
'modules': ['nova', 'glance']}]}, {'id': 'integrated',
'title': 'Integrated',
'modules': ['nova', 'glance']}]},
test_api.make_records(record_type=['commit'], test_api.make_records(record_type=['commit'],
module=['glance', 'nova', 'nova-cli'])): module=['glance', 'nova', 'nova-cli'])):
@ -73,26 +75,27 @@ class TestAPIModules(test_api.TestAPI):
def test_get_module(self): def test_get_module(self):
with test_api.make_runtime_storage( with test_api.make_runtime_storage(
{'repos': [ {
{'module': 'nova', 'organization': 'openstack', 'repos': [
'uri': 'git://git.openstack.org/openstack/nova.git'}], {'module': 'nova', 'organization': 'openstack',
'module_groups': { 'uri': 'git://git.openstack.org/openstack/nova.git'}],
'nova-group': {'id': 'nova-group', 'module_groups': {
'module_group_name': 'nova-group', 'nova-group': {'id': 'nova-group',
'modules': ['nova-cli', 'nova'], 'module_group_name': 'nova-group',
'tag': 'group'}, 'modules': ['nova-cli', 'nova'],
'nova': test_api.make_module('nova'), 'tag': 'group'},
'nova-cli': test_api.make_module('nova-cli'), 'nova': test_api.make_module('nova'),
}, 'nova-cli': test_api.make_module('nova-cli'),
'releases': [{'release_name': 'prehistory', },
'end_date': 1234567890}, 'releases': [{'release_name': 'prehistory',
{'release_name': 'icehouse', 'end_date': 1234567890},
'end_date': 1234567890}], {'release_name': 'icehouse',
'project_types': [ 'end_date': 1234567890}],
{'id': 'all', 'title': 'All', 'project_types': [
'modules': ['nova', 'glance', 'nova-cli']}, {'id': 'all', 'title': 'All',
{'id': 'openstack', 'title': 'OpenStack', 'modules': ['nova', 'glance', 'nova-cli']},
'modules': ['nova', 'glance']}]}, {'id': 'openstack', 'title': 'OpenStack',
'modules': ['nova', 'glance']}]},
test_api.make_records(record_type=['commit'])): test_api.make_records(record_type=['commit'])):
response = self.app.get('/api/1.0/modules/nova') response = self.app.get('/api/1.0/modules/nova')

View File

@ -20,26 +20,28 @@ class TestAPIStats(test_api.TestAPI):
def test_get_modules(self): def test_get_modules(self):
with test_api.make_runtime_storage( with test_api.make_runtime_storage(
{'repos': [ {
{'module': 'nova', 'organization': 'openstack', 'repos': [
'uri': 'git://git.openstack.org/openstack/nova.git'}, {'module': 'nova', 'organization': 'openstack',
{'module': 'glance', 'organization': 'openstack', 'uri': 'git://git.openstack.org/openstack/nova.git'},
'uri': 'git://git.openstack.org/openstack/glance.git'}], {'module': 'glance', 'organization': 'openstack',
'releases': [{'release_name': 'prehistory', 'uri': 'git://git.openstack.org/openstack/glance.git'}
'end_date': 1234567890}, ],
{'release_name': 'icehouse', 'releases': [{'release_name': 'prehistory',
'end_date': 1234567890}], 'end_date': 1234567890},
'module_groups': { {'release_name': 'icehouse',
'openstack': {'id': 'openstack', 'end_date': 1234567890}],
'module_group_name': 'openstack', 'module_groups': {
'modules': ['nova', 'glance'], 'openstack': {'id': 'openstack',
'tag': 'group'}, 'module_group_name': 'openstack',
'nova': test_api.make_module('nova'), 'modules': ['nova', 'glance'],
'glance': test_api.make_module('glance'), 'tag': 'group'},
}, 'nova': test_api.make_module('nova'),
'project_types': [ 'glance': test_api.make_module('glance'),
{'id': 'all', 'title': 'All', },
'modules': ['nova', 'glance']}]}, 'project_types': [
{'id': 'all', 'title': 'All',
'modules': ['nova', 'glance']}]},
test_api.make_records(record_type=['commit'], test_api.make_records(record_type=['commit'],
loc=[10, 20, 30], loc=[10, 20, 30],
module=['nova']), module=['nova']),
@ -57,36 +59,39 @@ class TestAPIStats(test_api.TestAPI):
def test_get_engineers(self): def test_get_engineers(self):
with test_api.make_runtime_storage( with test_api.make_runtime_storage(
{'repos': [ {
{'module': 'nova', 'project_type': 'openstack', 'repos': [
'organization': 'openstack', {'module': 'nova', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/nova.git'}, 'organization': 'openstack',
{'module': 'glance', 'project_type': 'openstack', 'uri': 'git://git.openstack.org/openstack/nova.git'},
'organization': 'openstack', {'module': 'glance', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/glance.git'}], 'organization': 'openstack',
'releases': [{'release_name': 'prehistory', 'uri': 'git://git.openstack.org/openstack/glance.git'}
'end_date': 1234567890}, ],
{'release_name': 'icehouse', 'releases': [{'release_name': 'prehistory',
'end_date': 1234567890}], 'end_date': 1234567890},
'module_groups': { {'release_name': 'icehouse',
'openstack': {'id': 'openstack', 'end_date': 1234567890}],
'module_group_name': 'openstack', 'module_groups': {
'modules': ['nova', 'glance'], 'openstack': {'id': 'openstack',
'tag': 'group'}, 'module_group_name': 'openstack',
'nova': test_api.make_module('nova'), 'modules': ['nova', 'glance'],
'glance': test_api.make_module('glance'), 'tag': 'group'},
}, 'nova': test_api.make_module('nova'),
'project_types': [ 'glance': test_api.make_module('glance'),
{'id': 'all', 'title': 'All', },
'modules': ['nova', 'glance']}], 'project_types': [
'user:john_doe': { {'id': 'all', 'title': 'All',
'seq': 1, 'user_id': 'john_doe', 'user_name': 'John Doe', 'modules': ['nova', 'glance']}],
'companies': [{'company_name': 'NEC', 'end_date': 0}], 'user:john_doe': {
'emails': ['john_doe@gmail.com'], 'core': []}, 'seq': 1, 'user_id': 'john_doe',
'user:bill': { 'user_name': 'John Doe',
'seq': 1, 'user_id': 'bill', 'user_name': 'Bill Smith', 'companies': [{'company_name': 'NEC', 'end_date': 0}],
'companies': [{'company_name': 'IBM', 'end_date': 0}], 'emails': ['john_doe@gmail.com'], 'core': []},
'emails': ['bill_smith@gmail.com'], 'core': []}}, 'user:bill': {
'seq': 1, 'user_id': 'bill', 'user_name': 'Bill Smith',
'companies': [{'company_name': 'IBM', 'end_date': 0}],
'emails': ['bill_smith@gmail.com'], 'core': []}},
test_api.make_records(record_type=['commit'], test_api.make_records(record_type=['commit'],
loc=[10, 20, 30], loc=[10, 20, 30],
module=['nova'], module=['nova'],
@ -110,36 +115,40 @@ class TestAPIStats(test_api.TestAPI):
def test_get_engineers_extended(self): def test_get_engineers_extended(self):
with test_api.make_runtime_storage( with test_api.make_runtime_storage(
{'repos': [ {
{'module': 'nova', 'project_type': 'openstack', 'repos': [
'organization': 'openstack', {'module': 'nova', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/nova.git'}, 'organization': 'openstack',
{'module': 'glance', 'project_type': 'openstack', 'uri': 'git://git.openstack.org/openstack/nova.git'},
'organization': 'openstack', {'module': 'glance', 'project_type': 'openstack',
'uri': 'git://git.openstack.org/openstack/glance.git'}], 'organization': 'openstack',
'releases': [{'release_name': 'prehistory', 'uri': 'git://git.openstack.org/openstack/glance.git'}
'end_date': 1234567890}, ],
{'release_name': 'icehouse', 'releases': [{'release_name': 'prehistory',
'end_date': 1234567890}], 'end_date': 1234567890},
'module_groups': { {'release_name': 'icehouse',
'openstack': {'id': 'openstack', 'end_date': 1234567890}],
'module_group_name': 'openstack', 'module_groups': {
'modules': ['nova', 'glance'], 'openstack': {'id': 'openstack',
'tag': 'group'}, 'module_group_name': 'openstack',
'nova': test_api.make_module('nova'), 'modules': ['nova', 'glance'],
'glance': test_api.make_module('glance'), 'tag': 'group'},
}, 'nova': test_api.make_module('nova'),
'project_types': [ 'glance': test_api.make_module('glance'),
{'id': 'all', 'title': 'All', },
'modules': ['nova', 'glance']}], 'project_types': [
'user:john_doe': { {'id': 'all', 'title': 'All',
'seq': 1, 'user_id': 'john_doe', 'user_name': 'John Doe', 'modules': ['nova', 'glance']}],
'companies': [{'company_name': 'NEC', 'end_date': 0}], 'user:john_doe': {
'emails': ['john_doe@gmail.com'], 'core': []}, 'seq': 1, 'user_id': 'john_doe',
'user:smith': { 'user_name': 'John Doe',
'seq': 1, 'user_id': 'smith', 'user_name': 'Bill Smith', 'companies': [{'company_name': 'NEC', 'end_date': 0}],
'companies': [{'company_name': 'IBM', 'end_date': 0}], 'emails': ['john_doe@gmail.com'], 'core': []},
'emails': ['bill_smith@gmail.com'], 'core': []}}, 'user:smith': {
'seq': 1, 'user_id': 'smith',
'user_name': 'Bill Smith',
'companies': [{'company_name': 'IBM', 'end_date': 0}],
'emails': ['bill_smith@gmail.com'], 'core': []}},
test_api.make_records(record_type=['commit'], test_api.make_records(record_type=['commit'],
loc=[10, 20, 30], loc=[10, 20, 30],
module=['nova'], module=['nova'],

View File

@ -47,9 +47,10 @@ update the block_device_mapping with the potentially new connection_info \
returned. returned.
Fixes bug <a href="https://bugs.launchpad.net/bugs/1076801" class="ext_link">\ Fixes bug <a href="https://bugs.launchpad.net/bugs/1076801" class="ext_link">\
1076801</a> 1076801</a>
''' + ('Change-Id: <a href="https://review.openstack.org/#q,' ''' + (
'Ie49ccd2138905e178843b375a9b16c3fe572d1db,n,z" class="ext_link">' 'Change-Id: <a href="https://review.openstack.org/#q,'
'Ie49ccd2138905e178843b375a9b16c3fe572d1db</a>') 'Ie49ccd2138905e178843b375a9b16c3fe572d1db,n,z" class="ext_link">'
'Ie49ccd2138905e178843b375a9b16c3fe572d1db</a>')
observed = helpers.make_commit_message(record) observed = helpers.make_commit_message(record)

View File

@ -40,8 +40,8 @@ downloadcache = ~/cache/pip
commands = python setup.py build_sphinx commands = python setup.py build_sphinx
[flake8] [flake8]
# E125 continuation line does not distinguish itself from next logical line # H904 Wrap long lines in parentheses instead of a backslash
ignore = E125 ignore = H904
show-source = true show-source = true
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,build exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,build