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

Commit

Permalink
Merge branch 'main' into fix-deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Nov 14, 2023
2 parents d332420 + 2d5d030 commit c48ee80
Show file tree
Hide file tree
Showing 16 changed files with 279 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.10.1
hooks:
- id: black
args: [--safe, --quiet]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.3.0]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -20,7 +20,7 @@ repos:
# - id: isort
# exclude: tests/data
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args:
Expand Down
3 changes: 1 addition & 2 deletions boa/cli/boa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from boa.core.config import init_global_config
from boa._version import __version__
from mamba.utils import init_api_context
from boa.core.utils import init_api_context

from conda_build.conda_interface import cc_conda_build

Expand All @@ -26,7 +26,6 @@


def main(config=None):

parser = argparse.ArgumentParser(
description="Boa, the fast, mamba powered-build tool for conda packages."
)
Expand Down
1 change: 0 additions & 1 deletion boa/cli/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def order_output_dict(d):


def main(docname):

with open(docname, "r") as fi:
lines = fi.readlines()
context = {}
Expand Down
2 changes: 1 addition & 1 deletion boa/cli/mambabuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from boa.core.solver import MambaSolver
from boa.core.utils import normalize_subdir
from mamba.utils import init_api_context
from boa.core.utils import init_api_context
from boa.core.config import boa_config

only_dot_or_digit_re = re.compile(r"^[\d\.]+$")
Expand Down
3 changes: 0 additions & 3 deletions boa/core/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ def select_files(files, include_files, exclude_files):


def bundle_conda(metadata, initial_files, env, files_selector=None):

files = post_process_files(metadata, initial_files)

# first filter is so that info_files does not pick up ignored files
Expand Down Expand Up @@ -374,7 +373,6 @@ def bundle_conda(metadata, initial_files, env, files_selector=None):


def write_build_scripts(m, script, build_file):

with utils.path_prepended(m.config.host_prefix):
with utils.path_prepended(m.config.build_prefix):
env = environ.get_dict(m=m)
Expand Down Expand Up @@ -467,7 +465,6 @@ def write_build_scripts(m, script, build_file):


def execute_build_script(m, src_dir, env, provision_only=False):

script_list = utils.ensure_list(m.get_value("build/script", None))
if script_list:
script = "\n".join(script_list)
Expand Down
2 changes: 0 additions & 2 deletions boa/core/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def build_string_from_metadata(metadata):
("mro", "mro-base", 3),
("mro", "mro-base_impl", 3),
):

for ms in metadata.ms_depends("run"):
for name in ensure_list(names):
if ms.name == name and name in build_pkg_names:
Expand Down Expand Up @@ -97,7 +96,6 @@ def build_string_from_metadata(metadata):


class MetaData:

path: str
uses_new_style_compiler_activation: bool = False
uses_vcs_in_meta: bool = False
Expand Down
1 change: 0 additions & 1 deletion boa/core/recipe_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ def set_final_build_id(self, meta, all_outputs):
self.data["build"]["run_exports"] = final_run_exports or None

def finalize_solve(self, all_outputs):

self._solve_env("build", all_outputs)
self._solve_env("host", all_outputs)
self._solve_env("run", all_outputs)
Expand Down
6 changes: 4 additions & 2 deletions boa/core/run_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def recursive_add(target):

sorted_recipes = toposort.toposort(sort_recipes)
num_recipes = len(sorted_recipes)
console.print(f"Found {num_recipes} recipe{'s'[:num_recipes^1]}")
console.print(f"Found {num_recipes} recipe{'s'[:num_recipes ^ 1]}")
for rec in sorted_recipes:
console.print(f" - {rec}")

Expand Down Expand Up @@ -198,7 +198,6 @@ def build_recipe(
rerun_build: bool = False,
pyproject_recipes=False,
):

ydoc = render(recipe_path, config=config, is_pyproject_recipe=pyproject_recipes)
# We need to assemble the variants for each output
variants = {}
Expand Down Expand Up @@ -479,6 +478,9 @@ def run_build(args: argparse.Namespace) -> None:
config.zstd_compression_level = args.zstd_compression_level

cbc, config = get_config(folder, variant, args.variant_config_files, config=config)
if config.variant and "cdt_name" in cbc:
# HACK: cdt_name is a list
config.variant["cdt_name"] = cbc["cdt_name"][0]

if hasattr(args, "output_folder") and args.output_folder:
config.output_folder = args.output_folder
Expand Down
5 changes: 1 addition & 4 deletions boa/core/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@
from boltons.setutils import IndexedSet

import libmambapy
import mamba
from mamba.utils import get_index, load_channels, to_package_record_from_subjson

from boa.core.utils import get_index, load_channels, to_package_record_from_subjson
from boa.core.config import boa_config

console = boa_config.console

solver_cache = {}

MAMBA_17_UP = mamba.version_info >= (0, 17, 0)


def refresh_solvers():
for _, v in solver_cache.items():
Expand Down
5 changes: 3 additions & 2 deletions boa/core/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import subprocess
import sys
from conda.core.package_cache_data import PackageCacheData
import ruamel
from ruamel.yaml import YAML
import tempfile
from pathlib import Path
from os.path import isdir, join
Expand Down Expand Up @@ -64,7 +64,8 @@ def get_metadata(yml, config, is_pyproject_recipe=False):

d = toml.load(fi)["tool"]["boa"]
else:
d = ruamel.yaml.safe_load(fi)
loader = YAML(typ="safe", pure=True)
d = loader.load(fi)
o = Output(d, config)
return MetaData(os.path.dirname(yml), o)

Expand Down
Loading

0 comments on commit c48ee80

Please sign in to comment.