Skip to content

Commit

Permalink
Remove unused args for execute/install_actions
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
  • Loading branch information
mbargull committed Jan 19, 2024
1 parent f410de4 commit 9d5a2f5
Showing 1 changed file with 13 additions and 40 deletions.
53 changes: 13 additions & 40 deletions conda_build/_legacy_conda_imports/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from collections import defaultdict
from logging import getLogger
from os.path import basename, isdir

from .conda_imports import (
DEFAULTS_CHANNEL_NAME,
Expand All @@ -38,8 +37,6 @@

log = getLogger(__name__)

# TODO: Remove conda/plan.py. This module should be almost completely deprecated now.


def display_actions(actions):
prefix = actions.get(PREFIX)
Expand Down Expand Up @@ -107,10 +104,7 @@ def format(s, pkg):
print()


# ---------------------------- Backwards compat for conda-build --------------------------


def execute_actions(actions, verbose=False):
def execute_actions(actions):
assert PREFIX in actions and actions[PREFIX]
prefix = actions[PREFIX]

Expand Down Expand Up @@ -143,47 +137,26 @@ def execute_actions(actions, verbose=False):
unlink_link_transaction.execute()


def install_actions(
prefix,
index,
specs,
force=False,
only_names=None,
always_copy=False,
pinned=True,
update_deps=True,
prune=False,
channel_priority_map=None,
is_update=False,
minimal_hint=False,
): # pragma: no cover
# this is for conda-build
def install_actions(prefix, index, specs):
with env_vars(
{
"CONDA_ALLOW_NON_CHANNEL_URLS": "true",
"CONDA_SOLVER_IGNORE_TIMESTAMPS": "false",
},
stack_callback=stack_context_default,
):
if channel_priority_map:
channel_names = IndexedSet(
Channel(url).canonical_name for url in channel_priority_map
# a hack since in conda-build we don't track channel_priority_map
if LAST_CHANNEL_URLS:
channel_priority_map = prioritize_channels(LAST_CHANNEL_URLS)
channels = IndexedSet(Channel(url) for url in channel_priority_map)
subdirs = (
IndexedSet(
subdir for subdir in (c.subdir for c in channels) if subdir
)
or context.subdirs
)
channels = IndexedSet(Channel(cn) for cn in channel_names)
subdirs = IndexedSet(basename(url) for url in channel_priority_map)
else:
# a hack for when conda-build calls this function without giving channel_priority_map
if LAST_CHANNEL_URLS:
channel_priority_map = prioritize_channels(LAST_CHANNEL_URLS)
channels = IndexedSet(Channel(url) for url in channel_priority_map)
subdirs = (
IndexedSet(
subdir for subdir in (c.subdir for c in channels) if subdir
)
or context.subdirs
)
else:
channels = subdirs = None
channels = subdirs = None

specs = tuple(MatchSpec(spec) for spec in specs)

Expand All @@ -196,7 +169,7 @@ def install_actions(
# package) => Copy index (just outer container, not deep copy)
# to conserve it.
solver._index = index.copy()
txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
txn = solver.solve_for_transaction(prune=False, ignore_pinned=False)
prefix_setup = txn.prefix_setups[prefix]
actions = {
PREFIX: prefix,
Expand Down

0 comments on commit 9d5a2f5

Please sign in to comment.