diff --git a/boa/core/recipe_output.py b/boa/core/recipe_output.py index 7d28d14a..1a9afa98 100644 --- a/boa/core/recipe_output.py +++ b/boa/core/recipe_output.py @@ -536,10 +536,10 @@ def _solve_env(self, env, all_outputs): subdir, output_folder=self.config.output_folder ) if env == "host": - MambaContext().target_prefix = self.config.host_prefix + MambaContext().prefix_params.target_prefix = self.config.host_prefix # solver.replace_installed(self.config.host_prefix) elif env == "build": - MambaContext().target_prefix = self.config.build_prefix + MambaContext().prefix_params.target_prefix = self.config.build_prefix # solver.replace_installed(self.config.build_prefix) t = solver.solve(specs, [pkg_cache]) diff --git a/boa/core/run_build.py b/boa/core/run_build.py index b80691dc..8955053e 100644 --- a/boa/core/run_build.py +++ b/boa/core/run_build.py @@ -332,7 +332,7 @@ def build_recipe( rm_rf(o.config.build_prefix) mkdir_p(os.path.join(o.config.build_prefix, "conda-meta")) try: - MambaContext().target_prefix = o.config.build_prefix + MambaContext().prefix_params.target_prefix = o.config.build_prefix o.transactions["build"]["transaction"].print() o.transactions["build"]["transaction"].execute( PrefixData(o.config.build_prefix), @@ -343,7 +343,7 @@ def build_recipe( if "host" in o.transactions: mkdir_p(os.path.join(o.config.host_prefix, "conda-meta")) - MambaContext().target_prefix = o.config.host_prefix + MambaContext().prefix_params.target_prefix = o.config.host_prefix o.transactions["host"]["transaction"].print() o.transactions["host"]["transaction"].execute( PrefixData(o.config.host_prefix) diff --git a/boa/core/solver.py b/boa/core/solver.py index d8aa2efc..6056a7c1 100644 --- a/boa/core/solver.py +++ b/boa/core/solver.py @@ -9,7 +9,6 @@ from conda.common.serialize import json_dump from conda.models.prefix_graph import PrefixGraph from conda.core.prefix_data import PrefixData -from conda._vendor.boltons.setutils import IndexedSet from conda.models.match_spec import MatchSpec from conda.common.url import remove_auth, split_anaconda_token from conda.core.index import _supplement_index_with_system @@ -19,6 +18,8 @@ from conda_build.conda_interface import pkgs_dirs from conda.core.package_cache_data import PackageCacheData +from boltons.setutils import IndexedSet + import libmambapy from boa.core.utils import get_index, load_channels, to_package_record_from_subjson @@ -235,7 +236,7 @@ def solve(self, specs, pkg_cache_path=None): pkg_cache_path = pkgs_dirs package_cache = libmambapy.MultiPackageCache(pkg_cache_path) - return libmambapy.Transaction(api_solver, package_cache) + return libmambapy.Transaction(self.pool, api_solver, package_cache) def solve_for_action(self, specs, prefix): t = self.solve(specs) diff --git a/boa/core/test.py b/boa/core/test.py index afd391cd..0c16b468 100644 --- a/boa/core/test.py +++ b/boa/core/test.py @@ -409,18 +409,14 @@ def check_file_existence(f_paths, check_parent_dir=False): for each_f in f_paths: if check_parent_dir and os.path.isdir(Path(each_f).parent): console.print( - f"[green]\N{check mark} {Path(each_f).parent} (directory)[/green]".encode( - "utf-8" - ) + f"[green]\N{check mark} {Path(each_f).parent} (directory)[/green]" ) if os.path.isdir(each_f): - console.print( - f"[green]\N{check mark} {each_f} (directory)[/green]".encode("utf-8") - ) + console.print(f"[green]\N{check mark} {each_f} (directory)[/green]") elif os.path.isfile(each_f): - console.print(f"[green]\N{check mark} {each_f}[/green]".encode("utf-8")) + console.print(f"[green]\N{check mark} {each_f}[/green]") else: - console.print(f"[red]\N{multiplication x} {each_f}[/red]".encode("utf-8")) + console.print(f"[red]\N{multiplication x} {each_f}[/red]") all_exist = False return all_exist @@ -520,13 +516,9 @@ def check_cmake(prefix, cmake_find): stderr=subprocess.DEVNULL, ) if cmake_check.returncode == 0: - console.print( - f"[green]\N{check mark} {each_f}[/green]".encode("utf-8") - ) + console.print(f"[green]\N{check mark} {each_f}[/green]") else: - console.print( - f"[red]\N{multiplication x} {each_f}[/red]".encode("utf-8") - ) + console.print(f"[red]\N{multiplication x} {each_f}[/red]") test_cmake = False return test_cmake @@ -553,11 +545,9 @@ def check_pkg_config(prefix, pkg_config): pkg_config_exists.returncode == 0 and pkg_config_validate.returncode == 0 ): - console.print(f"[green]\N{check mark} {each_f}[/green]".encode("utf-8")) + console.print(f"[green]\N{check mark} {each_f}[/green]") else: - console.print( - f"[red]\N{multiplication x} {each_f}[/red]".encode("utf-8") - ) + console.print(f"[red]\N{multiplication x} {each_f}[/red]") test_pkg_config = False return test_pkg_config @@ -579,13 +569,9 @@ def check_glob(prefix, glob_paths): each_glob_path = os.path.join(prefix, each_f) if glob(each_glob_path): for each_gp in glob(each_glob_path): - console.print( - f"[green]\N{check mark} {each_gp}[/green]".encode("utf-8") - ) + console.print(f"[green]\N{check mark} {each_gp}[/green]") else: - console.print( - f"[red]\N{multiplication x} {each_glob_path}[/red]".encode("utf-8") - ) + console.print(f"[red]\N{multiplication x} {each_glob_path}[/red]") test_glob = False return test_glob @@ -819,7 +805,7 @@ def run_test( pkg_cache_path = PackageCacheData.first_writable().pkgs_dir solver.replace_channels() - MambaContext().target_prefix = metadata.config.test_prefix + MambaContext().prefix_params.target_prefix = metadata.config.test_prefix transaction = solver.solve(specs, [pkg_cache_path]) downloaded = transaction.fetch_extract_packages() diff --git a/setup.py b/setup.py index 28c6dd47..7cf1d867 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ "prompt-toolkit", "joblib", "beautifulsoup4", + "boltons", ] setup( diff --git a/tests/env.yml b/tests/env.yml index 2090fae7..4606e083 100644 --- a/tests/env.yml +++ b/tests/env.yml @@ -4,8 +4,7 @@ channels: dependencies: - python>=3.7 - pip - - conda - - libmambapy <=1.4.2 + - libmambapy - pytest - "conda-build>=3.20" - ruamel