Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda 4.4 compatibility #96

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ install:

# Now do the things we need to do to install it.
- conda install -c conda-forge --file requirements.txt nose mock python=${PYTHON} ${EXTRA_DEPS} --yes --quiet
- if [[ -n ${CONDA_ORIGIN} ]]; then conda install -yq -c ${CONDA_ORIGIN} conda conda-build; fi
- if [[ -n ${CONDA_ORIGIN} ]]; then conda install -yq -c ${CONDA_ORIGIN} conda conda-build=2.1; fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...did we loose cb3 compatibility? Admittedly some things in cb3 weren't supported yet ( #97 ), but I thought it did work at least ( #93 ). 😕

- python setup.py install
- mkdir not_the_source_root && cd not_the_source_root

Expand Down
36 changes: 35 additions & 1 deletion conda_build_all/conda_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,41 @@

CONDA_VERSION_MAJOR_MINOR = tuple(int(x) for x in CONDA_VERSION.split('.')[:2])

if (4, 3) <= CONDA_VERSION_MAJOR_MINOR < (4, 4):
if (4, 4) <= CONDA_VERSION_MAJOR_MINOR < (4, 5):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this equivalent to: if CONDA_VERSION_MAJOR_MINOR == (4,4)?

from conda.lock import Locked
from conda.exports import get_index
from conda.exports import subdir
from conda.exports import MatchSpec
from conda.exports import Unsatisfiable
from conda.exports import NoPackagesFound
from conda.exports import string_types
from conda.models.dist import Dist as _Dist

def get_key(dist_or_filename):
return dist_or_filename

def copy_index(index):
return {_Dist(key): index[key] for key in index.keys()}

def ensure_dist_or_dict(fn):
return _Dist.from_string(fn)

from conda.gateways.logging import initialize_logging, set_verbosity
initialize_logging()
set_verbosity(1)

from conda.exports import Resolve as _Resolve
from conda.models.index_record import PackageRecord as _PackageRecord
from conda.models.dist import Dist as _Dist

class Resolve(_Resolve):
def __init__(self, index):
# ensure conversion of dicts to PackageRecord objects
super(Resolve, self).__init__(
{_Dist(dist): _PackageRecord.from_objects(rec) for dist, rec in index.items()}
)

elif (4, 3) <= CONDA_VERSION_MAJOR_MINOR < (4, 4):
from conda.lock import Locked
from conda.exports import get_index
from conda.exports import subdir
Expand Down
2 changes: 1 addition & 1 deletion conda_build_all/tests/unit/dummy_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __repr__(self):

class DummyIndex(dict):
def add_pkg(self, name, version, build_string='',
depends=(), build_number='0',
depends=(), build_number=0,
**extra_items):
if build_string:
build_string = '{}_{}'.format(build_string, build_number)
Expand Down