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

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 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
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 @@ -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),
Expand All @@ -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)
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

from boa.core.utils import get_index, load_channels, to_package_record_from_subjson
Expand Down Expand Up @@ -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)
Expand Down
36 changes: 11 additions & 25 deletions boa/core/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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()
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
3 changes: 1 addition & 2 deletions tests/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ channels:
dependencies:
- python>=3.7
- pip
- conda
- libmambapy <=1.4.2
- libmambapy
- pytest
- "conda-build>=3.20"
- ruamel
Expand Down
Loading