Skip to content

Commit

Permalink
Add comment explaining not using xrange + make Environment.setup priv…
Browse files Browse the repository at this point in the history
…ate again
  • Loading branch information
pv committed Jul 6, 2015
1 parent 53457ec commit d880953
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions asv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def create(self):
pass

try:
self.setup()
self._setup()
except:
log.error("Failure creating environment for {0}".format(self.name))
if os.path.exists(self._path):
Expand All @@ -301,7 +301,7 @@ def create(self):

self._is_setup = True

def setup(self):
def _setup(self):
"""
Implementation for setting up the environment.
"""
Expand Down Expand Up @@ -454,7 +454,7 @@ def check_presence(self):
def create(self):
pass

def setup(self):
def _setup(self):
pass

def install_project(self, conf, commit_hash=None):
Expand Down
4 changes: 4 additions & 0 deletions asv/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def resample_data(self, val):
max_time = max(x[0] for x in val)
step_size = int((max_time - min_time) / RESAMPLED_POINTS)

# This loop cannot use xrange, because xrange on Python2 on
# 32-bit systems can only deal with 32-bit integers, and
# Javascript timestamps (1000*unix_timestamp) handled here
# overflow this range
new_val = []
j = 0
i = min_time + step_size
Expand Down
2 changes: 1 addition & 1 deletion asv/plugins/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_environments(cls, conf, python):
for configuration in environment.iter_configuration_matrix(conf.matrix):
yield cls(conf, python, configuration)

def setup(self):
def _setup(self):
try:
conda = util.which('conda')
except IOError as e:
Expand Down
2 changes: 1 addition & 1 deletion asv/plugins/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def matches(self, python):
executable = Virtualenv._find_python(python)
return executable is not None

def setup(self):
def _setup(self):
"""
Setup the environment on disk using virtualenv.
Then, all of the requirements are installed into
Expand Down

0 comments on commit d880953

Please sign in to comment.