Skip to content

Commit

Permalink
Merge pull request #37 from dhellmann/requirements-ranges
Browse files Browse the repository at this point in the history
be more specific about requirements
  • Loading branch information
dhellmann committed Feb 16, 2016
2 parents b55c3a9 + b74ed64 commit 390e927
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 34 deletions.
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cliff
pyzmq
coverage
pecan
pygments
gprof2dot
six
beaker
cliff>=1.16.0
pyzmq>=14.3.1
coverage>=3.7.1
pecan>=0.6.1
pygments>=1.6.0
gprof2dot>=1.0
six>=1.7.3
Beaker>=1.6.4
2 changes: 1 addition & 1 deletion smiley/db_linecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _init_file(self, filename):
def getline(self, filename, line_no):
self._init_file(filename)
try:
return self._files[filename][line_no-1]
return self._files[filename][line_no - 1]
except IndexError:
# Line number is out of range
return ''
Expand Down
4 changes: 2 additions & 2 deletions smiley/presentation/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def format_data(run_id, stats, db):
yield {
'ncalls': '%s/%s' % (nc, cc) if nc != cc else str(nc),
'tottime': tt,
'percall_nc': (float(tt)/nc) if nc else '',
'percall_nc': (float(tt) / nc) if nc else '',
'cumtime': ct,
'percall_cc': (float(ct)/cc) if cc else '',
'percall_cc': (float(ct) / cc) if cc else '',
'filename': func[0],
'file_url': db.get_file_signature(run_id, func[0]),
'lineno': func[1],
Expand Down
4 changes: 2 additions & 2 deletions smiley/presentation/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def getline(self, filename, line_no):
# LOG.debug('getline(%s, %s)', filename, line_no)
self._init_file(filename)
try:
return self._files[filename][line_no-1]
return self._files[filename][line_no - 1]
except IndexError:
# Line number is out of range
return ''
Expand All @@ -65,4 +65,4 @@ def getlines(self, filename, start, end, include_comments=False):
filename,
start,
)
return '\n'.join(self._files[filename][start-1:end])
return '\n'.join(self._files[filename][start - 1:end])
12 changes: 4 additions & 8 deletions smiley/presentation/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ def collapse_trace(trace_iter):
vars_have_changed = True
break
do_yield = (
accumulate # we have something to yield
and
(vars_have_changed
or
accumulate.event != 'line' # that something can't be collapsed
or
t.event != 'line' # the next event can't be combined with it
or
accumulate and # we have something to yield
(vars_have_changed or
accumulate.event != 'line' or # that something can't be collapsed
t.event != 'line' or # the next event can't be combined with it
t.event != accumulate.event)
)
if do_yield:
Expand Down
12 changes: 6 additions & 6 deletions smiley/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ def _get_interesting_locals(self, frame):
for n, v in frame.f_locals.items()
# Ignore any modules, methods, or functions that have made
# their way into the "locals" namespace for this frame.
if (not inspect.ismodule(v)
and not inspect.isfunction(v)
and not inspect.ismethod(v)
and getattr(getattr(v, '__class__', 'UNKNONWN_CLASS'),
'__module__', 'UNKNOWN_MODULE') != '__future__'
and (n[:2] != '__' and n[-2:] != '__'))
if (not inspect.ismodule(v) and
not inspect.isfunction(v) and
not inspect.ismethod(v) and
getattr(getattr(v, '__class__', 'UNKNONWN_CLASS'),
'__module__', 'UNKNOWN_MODULE') != '__future__' and
(n[:2] != '__' and n[-2:] != '__'))
}

def _should_ignore_file(self, filename):
Expand Down
12 changes: 6 additions & 6 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
testrepository
testscenarios
testtools
python-subunit
mock
discover
testrepository>=0.0.18
testscenarios>=0.4.0
testtools>=0.9.35
python-subunit>=0.0.18
mock>=1.0.1
discover>=0.4.0
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ commands =
coverage report --show-missing --omit='smiley/tests/*'

[testenv:style]
deps = flake8
deps = flake8==2.5.4
commands = flake8 smiley

[testenv:docs]
Expand Down

0 comments on commit 390e927

Please sign in to comment.