Permalink
Browse files

don't require statprof as a dependency

  • Loading branch information...
1 parent 4bfe513 commit 5d6e07ff7970c515792cf737b876cf3a4363d54d @cyberdelia committed Aug 29, 2012
Showing with 4 additions and 4 deletions.
  1. +3 −2 metrology/instruments/profiler.py
  2. +1 −2 setup.py
@@ -1,7 +1,5 @@
from __future__ import division
-import statprof
-
from os.path import basename
from collections import defaultdict
@@ -13,6 +11,7 @@
class _Trace(object):
def __init__(self, data):
+ import statprof
self_sample_count = data.self_sample_count
cum_sample_count = data.cum_sample_count
sample_count = statprof.state.sample_count
@@ -44,6 +43,7 @@ def clear(self):
self.histogram.clear()
def __enter__(self):
+ import statprof
try:
statprof.reset(self.frequency)
except AssertionError:
@@ -57,6 +57,7 @@ def update(self, key, duration):
self.traces[key].update(duration)
def __exit__(self, type, value, callback):
+ import statprof
statprof.stop()
for call in statprof.CallData.all_calls.itervalues():
trace = _Trace(call)
View
@@ -22,8 +22,7 @@
install_requires=[
'astrolabe>=0.1.2',
'atomic>=0.3.2',
- 'bintrees>=1.0.0',
- 'statprof>=0.1.2'
+ 'bintrees>=1.0.0'
],
include_package_data=True,
classifiers=[

0 comments on commit 5d6e07f

Please sign in to comment.