Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

fix up some deprecation warnings and test with latest versions of con… #367

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions boa/core/recipe_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
4 changes: 2 additions & 2 deletions boa/core/run_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,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),
Expand All @@ -344,7 +344,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)
Expand Down
5 changes: 3 additions & 2 deletions boa/core/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
import mamba
from mamba.utils import get_index, load_channels, to_package_record_from_subjson
Expand Down Expand Up @@ -238,7 +239,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)
Expand Down
36 changes: 11 additions & 25 deletions boa/core/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,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

Expand Down Expand Up @@ -519,13 +515,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

Expand All @@ -552,11 +544,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

Expand All @@ -578,13 +568,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

Expand Down Expand Up @@ -818,7 +804,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()
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"prompt-toolkit",
"joblib",
"beautifulsoup4",
"boltons",
]

setup(
Expand Down
2 changes: 1 addition & 1 deletion tests/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- python>=3.7
- pip
- mamba
- libmambapy <=1.4.2
- libmambapy
- pytest
- "conda-build>=3.20"
- ruamel
Expand Down