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

put local channel behind user-specified channels, for remote priority #3038

Merged
merged 2 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 10 additions & 3 deletions conda_build/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def get_build_index(subdir, bldpkgs_dir, output_folder=None, clear_cache=False,

log.debug("Building new index for subdir '{}' with channels {}, condarc channels "
"= {}".format(subdir, channel_urls, not omit_defaults))
# priority: local by croot (can vary), then channels passed as args,
# then channels from config.
capture = contextlib.contextmanager(lambda: (yield))
if debug:
log_context = partial(utils.LoggingContext, logging.DEBUG)
Expand All @@ -73,9 +71,18 @@ def get_build_index(subdir, bldpkgs_dir, output_folder=None, clear_cache=False,
log_context = partial(utils.LoggingContext, logging.CRITICAL + 1)
capture = utils.capture

# priority: (local as either croot or output_folder IF NOT EXPLICITLY IN CHANNEL ARGS),
# then channels passed as args (if local in this, it remains in same order),
# then channels from condarc.
urls = list(channel_urls)

# this is where we add the "local" channel. It's a little smarter than conda, because
# conda does not know about our output_folder when it is not the default setting.
if os.path.isdir(output_folder):
urls.insert(0, url_path(output_folder))
if 'local' not in urls:
urls.insert(0, url_path(output_folder))
# replace local with the appropriate real channel. Order is maintained.
urls = [url if url != "local" else url_path(output_folder) for url in urls]
_ensure_valid_channel(output_folder, subdir, verbose=verbose, locking=locking,
timeout=timeout)

Expand Down
14 changes: 1 addition & 13 deletions conda_build/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from .conda_interface import hashsum_file, md5_file, unix_path_to_win, win_path_to_unix
from .conda_interface import PY3, iteritems
from .conda_interface import root_dir, pkgs_dirs
from .conda_interface import string_types, url_path, get_rc_urls
from .conda_interface import string_types
from .conda_interface import memoized
from .conda_interface import StringIO
from .conda_interface import VersionOrder, MatchSpec
Expand Down Expand Up @@ -1163,18 +1163,6 @@ def env_var(name, value, callback=None):
callback()


def collect_channels(config, is_host=False):
urls = [url_path(config.croot)] + get_rc_urls() + ['local', ]
if config.channel_urls:
urls.extend(config.channel_urls)
# defaults has a very limited set of repo urls. Omit it from the URL list so
# that it doesn't fail.
if config.is_cross and is_host:
urls.remove('defaults')
urls.remove('local')
return urls


def trim_empty_keys(dict_):
to_remove = set()
negative_means_empty = ('final', 'noarch_python', 'zip_keys')
Expand Down