Skip to content

Commit

Permalink
fix conda-build imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Dec 6, 2016
1 parent 1dfbe72 commit f13361b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 84 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ tmpfile.rc
.coverage*
*.bz2
tempfile.rc
.vagrant/
Vagrantfile
88 changes: 6 additions & 82 deletions conda/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
# Taken mostly from six.py by Benjamin Peterson.
# """
from __future__ import absolute_import, division, print_function, unicode_literals
#
# import sys
# import types
# import os
import warnings as _warnings
from tempfile import mkdtemp
#
# # True if we are running on Python 3.
# PY3 = sys.version_info[0] == 3
#


# shim for conda-build
from .common.compat import *
PY3 = PY3


class TemporaryDirectory(object):
"""Create and return a temporary directory. This has the same
Expand Down Expand Up @@ -59,77 +57,3 @@ def __exit__(self, exc, value, tb):
def __del__(self):
# Issue a ResourceWarning if implicit cleanup needed
self.cleanup(_warn=True)


# if PY3:
# string_types = str,
# integer_types = int,
# class_types = type,
# text_type = str
# binary_type = bytes
# input = input
# def lchmod(path, mode):
# try:
# os.chmod(path, mode, follow_symlinks=False)
# except (TypeError, NotImplementedError, SystemError):
# # On systems that don't allow permissions on symbolic links, skip
# # links entirely.
# if not os.path.islink(path):
# os.chmod(path, mode)
# import configparser
# from io import StringIO
# from itertools import zip_longest
# from shlex import quote
# range = range
# zip = zip
#
# else:
# import ConfigParser as configparser
# from cStringIO import StringIO
# string_types = basestring,
# integer_types = (int, long)
# class_types = (type, types.ClassType)
# text_type = unicode
# binary_type = str
# input = raw_input
# try:
# lchmod = os.lchmod
# except AttributeError:
# def lchmod(path, mode):
# # On systems that don't allow permissions on symbolic links, skip
# # links entirely.
# if not os.path.islink(path):
# os.chmod(path, mode)
# from itertools import izip_longest as zip_longest
# from math import log
# from pipes import quote
#
# # Modified from http://hg.python.org/cpython/file/3.3/Lib/tempfile.py. Don't
# # use the 3.4 one. It uses the new weakref.finalize feature.
# from tempfile import mkdtemp
# range = xrange
# # used elsewhere - do not remove
# from itertools import izip as zip
#
#
# if PY3:
# _iterkeys = "keys"
# _itervalues = "values"
# _iteritems = "items"
# else:
# _iterkeys = "iterkeys"
# _itervalues = "itervalues"
# _iteritems = "iteritems"
#
#
# def iterkeys(d):
# """Return an iterator over the keys of a dictionary."""
# return iter(getattr(d, _iterkeys)())
#
# def itervalues(d):
# """Return an iterator over the values of a dictionary."""
# return iter(getattr(d, _itervalues)())
#
# def iteritems(d):
# """Return an iterator over the (key, value) pairs of a dictionary."""
# return iter(getattr(d, _iteritems)())
3 changes: 2 additions & 1 deletion conda/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def execute_instructions(plan, index=None, verbose=False, _commands=None):
state['i'] - 1))
cmd = _commands[instruction]

cmd(state, arg)
if callable(cmd):
cmd(state, arg)

if (state['i'] is not None and instruction in PROGRESS_COMMANDS and
state['maxval'] == state['i']):
Expand Down
3 changes: 2 additions & 1 deletion conda/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def inject_UNLINKLINKTRANSACTION(plan):
link_dists = tuple(Dist(d[1]) for d in grouped_instructions.get(LINK, ()))
unlink_dists, link_dists = handle_menuinst(unlink_dists, link_dists)
plan.insert(first_unlink_link_idx, (UNLINKLINKTRANSACTION, (unlink_dists, link_dists)))
plan = [p for p in plan if p[0] not in (UNLINK, LINK)] # filter out unlink/link
# plan = [p for p in plan if p[0] not in (UNLINK, LINK)] # filter out unlink/link
# don't filter LINK and UNLINK, just don't do anything with them
return plan


Expand Down

0 comments on commit f13361b

Please sign in to comment.