Add numpy to extras

Move numpy out of requirements into extras, as it's not required
for running browbeat, but only used for insights like compare
results.

So to install with insights, pip install .[insights], to perform
the CLI operations such as compare.

Added a tox test to ensure no dep conflict arises.

Change-Id: Id8aafcd479003ae79ab8c2d0f1fa378ea38d60d2
Closes-Bug: #1799690
This commit is contained in:
agopi 2018-11-08 14:30:44 -05:00 committed by Aakarsh
parent 6746c0c948
commit 03be425102
5 changed files with 25 additions and 3 deletions

View File

@ -14,7 +14,6 @@ from collections import deque
import datetime import datetime
import json import json
import logging import logging
import numpy
import os import os
import re import re
import sys import sys
@ -181,6 +180,7 @@ class Elastic(object):
""" """
def summarize_results(self, data, combined): def summarize_results(self, data, combined):
import numpy
summary = {} summary = {}
if combined: if combined:
if len(data) > 1: if len(data) > 1:
@ -243,6 +243,7 @@ class Elastic(object):
""" """
def compare_rally_results(self, data, uuids, combined, metadata=None): def compare_rally_results(self, data, uuids, combined, metadata=None):
import numpy
missing = [] missing = []
if len(data) < 2: if len(data) < 2:
self.logger.error("Not enough data to compare") self.logger.error("Not enough data to compare")
@ -350,6 +351,7 @@ class Elastic(object):
""" """
def get_result_data(self, index, browbeat_uuid): def get_result_data(self, index, browbeat_uuid):
import numpy
results = [] results = []
data = [] data = []
metadata = {} metadata = {}

View File

@ -364,6 +364,16 @@ Compare performance of two different runs
Using the CLI the user can determine, run to run performance differences. This is a good tool for spot checking performance of an OpenStack Using the CLI the user can determine, run to run performance differences. This is a good tool for spot checking performance of an OpenStack
release. release.
You'll need to install extra dependencies for browbeat insights, which will
provide additional modules needed for providing insights.
To install :
::
$ source browbeat/.browbeat-venv/bin/activate
$ pip install .[insights]
To use : To use :
:: ::

View File

@ -1,7 +1,6 @@
# to avoid dependency conflicts, try to use ranges, eventually banning a # to avoid dependency conflicts, try to use ranges, eventually banning a
# buggy minor version (!=) or capping (<) once you have proof it breaks. # buggy minor version (!=) or capping (<) once you have proof it breaks.
ansible>=2.4.1 ansible>=2.4.1
numpy
elasticsearch elasticsearch
grafyaml>=0.0.7 grafyaml>=0.0.7
openstacksdk openstacksdk

View File

@ -45,3 +45,7 @@ universal = 1
[pbr] [pbr]
skip_authors = True skip_authors = True
skip_changelog = True skip_changelog = True
[extras]
insights =
numpy

View File

@ -1,6 +1,6 @@
[tox] [tox]
minversion = 2.0 minversion = 2.0
envlist = py27,py35,py36,linters,dist envlist = py27,py35,py36,linters,dist,insights
skipsdist = True skipsdist = True
[testenv] [testenv]
@ -15,6 +15,7 @@ commands = python setup.py test
# py3 linters are able to stop more than py2 ones # py3 linters are able to stop more than py2 ones
basepython = python3 basepython = python3
whitelist_externals = bash whitelist_externals = bash
extras = insights
commands = commands =
{[testenv:pep8]commands} {[testenv:pep8]commands}
bash -c "cd ansible; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \ bash -c "cd ansible; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
@ -35,6 +36,12 @@ commands =
python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel
python -m twine check dist/* python -m twine check dist/*
[testenv:insights]
commands =
pip check
pip install .[insights]
pip check
[testenv:pep8] [testenv:pep8]
commands = flake8 {posargs} commands = flake8 {posargs}