Add tox.ini, setup.py and do syntax cleanup
Add tox.ini and setup.py files. Do syntax cleanup of bugdaystats.py so checks pass now with tox.ini applied. Also update .git files. Change-Id: I7a65138bab4cb5e1194e0b35c94a847df70e3004
This commit is contained in:
parent
a878b43380
commit
f14d070ed9
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
|||||||
output/*.html
|
output/*.html
|
||||||
output/*.json
|
output/*.json
|
||||||
config.js
|
config.js
|
||||||
|
bugdaystats.egg-info
|
||||||
|
4
.gitreview
Normal file
4
.gitreview
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[gerrit]
|
||||||
|
host=review.openstack.org
|
||||||
|
port=29418
|
||||||
|
project=openstack-infra/bugdaystats.git
|
@ -75,8 +75,8 @@ def update_stats(outputpath, project_name, rotation):
|
|||||||
open_tasks = project.searchTasks(status=open_statuses,
|
open_tasks = project.searchTasks(status=open_statuses,
|
||||||
order_by='-datecreated',
|
order_by='-datecreated',
|
||||||
omit_duplicates=True)
|
omit_duplicates=True)
|
||||||
open_tasks_count = int(
|
open_tasks_count = int(open_tasks._wadl_resource.representation
|
||||||
open_tasks._wadl_resource.representation['total_size'])
|
['total_size'])
|
||||||
|
|
||||||
counts['date'] = now
|
counts['date'] = now
|
||||||
|
|
||||||
@ -124,13 +124,11 @@ def update_stats(outputpath, project_name, rotation):
|
|||||||
|
|
||||||
records.append(counts)
|
records.append(counts)
|
||||||
|
|
||||||
report = {
|
report = {'keys': ['date', 'new', 'incomplete', 'confirmed', 'triaged',
|
||||||
'keys': ['date', 'new', 'incomplete', 'confirmed', 'triaged',
|
|
||||||
'inprogress', 'fixcommitted', 'fixreleased', 'invalid',
|
'inprogress', 'fixcommitted', 'fixreleased', 'invalid',
|
||||||
'wontfix', 'undecided', 'wishlist', 'low', 'medium',
|
'wontfix', 'undecided', 'wishlist', 'low', 'medium',
|
||||||
'high', 'critical'],
|
'high', 'critical'],
|
||||||
'records': records
|
'records': records}
|
||||||
}
|
|
||||||
|
|
||||||
project_stats_file = open(project_stats_filename, 'w')
|
project_stats_file = open(project_stats_filename, 'w')
|
||||||
project_stats_file.write(json.dumps(report, indent=4))
|
project_stats_file.write(json.dumps(report, indent=4))
|
||||||
|
28
setup.py
Normal file
28
setup.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
# implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="bugdaystats",
|
||||||
|
author="Thierry Carrez",
|
||||||
|
scripts=['bugdaystats.py'],
|
||||||
|
install_requires=[
|
||||||
|
"launchpadlib",
|
||||||
|
"jinja2",
|
||||||
|
],
|
||||||
|
)
|
13
tox.ini
Normal file
13
tox.ini
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[tox]
|
||||||
|
envlist = pyflakes, pep8, py27
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
install_command = pip install --allow-external lazr.authentication --allow-insecure lazr.authentication -U {opts} {packages}
|
||||||
|
|
||||||
|
[testenv:pyflakes]
|
||||||
|
deps = pyflakes
|
||||||
|
commands = pyflakes bugdaystats.py
|
||||||
|
|
||||||
|
[testenv:pep8]
|
||||||
|
deps = pep8==1.3.3
|
||||||
|
commands = pep8 --ignore=E125 --repeat --show-source --exclude=.tox .
|
Loading…
x
Reference in New Issue
Block a user