Skip to content
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
49 changes: 28 additions & 21 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,9 @@ def copy_test_source_files(m, destination):
except OSError as e:
log = utils.get_logger(__name__)
log.warning(
f"Failed to copy {f} into test files. Error was: {str(e)}"
"Failed to copy %s into test files. Error was: %s",
f,
str(e),
)
for ext in ".pyc", ".pyo":
for f in utils.get_ext_files(destination, ext):
Expand Down Expand Up @@ -1632,11 +1634,13 @@ def post_process_files(m: MetaData, initial_prefix_files):
if len(missing):
log = utils.get_logger(__name__)
log.warning(
f"The install/build script(s) for {package_name} deleted the following "
f"files (from dependencies) from the prefix:\n{missing}\n"
"The install/build script(s) for %s deleted the following "
"files (from dependencies) from the prefix:\n%s\n"
"This will cause the post-link checks to mis-report. Please "
"try not to delete and files (DSOs in particular) from the "
"prefix"
"prefix",
package_name,
missing,
)
get_build_metadata(m)
create_post_scripts(m)
Expand Down Expand Up @@ -1850,9 +1854,7 @@ def bundle_conda(
}
elif not output.get("script"):
if not metadata.always_include_files():
log.warning(
"No files or script found for output {}".format(output.get("name"))
)
log.warning("No files or script found for output %s", output.get("name"))
build_deps = metadata.get_value("requirements/build")
host_deps = metadata.get_value("requirements/host")
build_pkgs = [pkg.split()[0] for pkg in build_deps]
Expand Down Expand Up @@ -1971,7 +1973,8 @@ def bundle_conda(
except KeyError as e:
log.warning(
"Package doesn't have necessary files. It might be too old to inspect."
f"Legacy noarch packages are known to fail. Full message was {e}"
"Legacy noarch packages are known to fail. Full message was %s",
e,
)
try:
crossed_subdir = metadata.config.target_subdir
Expand Down Expand Up @@ -2203,8 +2206,9 @@ def _write_activation_text(script_path, m):
else:
log = utils.get_logger(__name__)
log.warning(
f"not adding activation to {script_path} - I don't know how to do so for "
"this file type"
"not adding activation to %s - I don't know how to do so for "
"this file type",
script_path,
)
fh.write(data)

Expand Down Expand Up @@ -2685,7 +2689,7 @@ def build(
)
pkg_path = bldpkg_path(m)
if pkg_path not in built_packages and pkg_path not in new_pkgs:
log.info(f"Packaging {m.name()}")
log.info("Packaging %s", m.name())
# for more than one output, we clear and rebuild the environment before each
# package. We also do this for single outputs that present their own
# build reqs.
Expand Down Expand Up @@ -2802,12 +2806,11 @@ def build(
prev_csum = prev_output_d["checksums"][file]
nature = "Exact" if csum == prev_csum else "Inexact"
log.warning(
"{} overlap between {} in packages {} and {}".format(
nature,
file,
output_d["name"],
prev_output_d["name"],
)
"%s overlap between %s in packages %s and %s",
nature,
file,
output_d["name"],
prev_output_d["name"],
)
for built_package in newly_built_packages:
new_pkgs[built_package] = (output_d, m)
Expand Down Expand Up @@ -3561,7 +3564,9 @@ def tests_failed(
try:
shutil.move(pkg, dest)
log.warning(
f"Tests failed for {os.path.basename(pkg)} - moving package to {broken_dir}"
"Tests failed for %s - moving package to %s",
os.path.basename(pkg),
broken_dir,
)
except OSError:
pass
Expand Down Expand Up @@ -3719,7 +3724,7 @@ def build_tree(
else:
downstreams = utils.ensure_list(downstreams)
for dep in downstreams:
log.info(f"Testing downstream package: {dep}")
log.info("Testing downstream package: %s", dep)
# resolve downstream packages to a known package

r_string = "".join(
Expand Down Expand Up @@ -3752,8 +3757,10 @@ def build_tree(
DependencyNeedsBuildingError,
) as e:
log.warning(
f"Skipping downstream test for spec {dep}; was "
f"unsatisfiable. Error was {e}"
"Skipping downstream test for spec %s; was "
"unsatisfiable. Error was %s",
dep,
e,
)
continue
# make sure to download that package to the local cache if not there
Expand Down
3 changes: 2 additions & 1 deletion conda_build/cli/main_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def execute(args: Sequence[str] | None = None) -> int:
if parsed.file and len(metadata_tuples) > 1:
log.warning(
"Multiple variants rendered. "
f"Only one will be written to the file you specified ({parsed.file})."
"Only one will be written to the file you specified (%s).",
parsed.file,
)

if parsed.output:
Expand Down
10 changes: 5 additions & 5 deletions conda_build/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ def verify_git_repo(
# metadata git_url or git_rev, then we aren't looking at the right source.
if not os.path.isdir(remote_url) and remote_url.lower() != git_url.lower():
log.debug("remote does not match git_url")
log.debug("Remote: " + remote_url.lower())
log.debug("git_url: " + git_url.lower())
log.debug("Remote: %s", remote_url.lower())
log.debug("git_url: %s", git_url.lower())
OK = False
except subprocess.CalledProcessError as error:
log.debug("Error obtaining git information in verify_git_repo. Error was: ")
Expand Down Expand Up @@ -849,7 +849,7 @@ def get_install_actions(
global last_index_ts

log = utils.get_logger(__name__)
conda_log_level = logging.WARN
conda_log_level = logging.WARNING
specs = list(specs)
if specs:
specs.extend(context.create_default_packages)
Expand Down Expand Up @@ -1099,7 +1099,7 @@ def create_env(
if config.debug:
external_logger_context = utils.LoggingContext(logging.DEBUG)
else:
external_logger_context = utils.LoggingContext(logging.WARN)
external_logger_context = utils.LoggingContext(logging.WARNING)

if os.path.exists(prefix):
for entry in glob(os.path.join(prefix, "*")):
Expand Down Expand Up @@ -1326,7 +1326,7 @@ def get_pkg_dirs_locks(dirs, config):


def clean_pkg_cache(dist: str, config: Config) -> None:
with utils.LoggingContext(logging.DEBUG if config.debug else logging.WARN):
with utils.LoggingContext(logging.DEBUG if config.debug else logging.WARNING):
locks = get_pkg_dirs_locks((config.bldpkgs_dir, *context.pkgs_dirs), config)
with utils.try_acquire_locks(locks, timeout=config.timeout):
for pkgs_dir in context.pkgs_dirs:
Expand Down
4 changes: 3 additions & 1 deletion conda_build/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def get_build_index(
if debug:
log_context = partial(utils.LoggingContext, logging.DEBUG, loggers=loggers)
elif verbose:
log_context = partial(utils.LoggingContext, logging.WARN, loggers=loggers)
log_context = partial(
utils.LoggingContext, logging.WARNING, loggers=loggers
)
else:
log_context = partial(
utils.LoggingContext, logging.CRITICAL + 1, loggers=loggers
Expand Down
17 changes: 10 additions & 7 deletions conda_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ def _trim_None_strings(meta_dict):
meta_dict[key] = keep
else:
log.debug(
f"found unrecognized data type in dictionary: {value}, type: {type(value)}"
"found unrecognized data type in dictionary: %s, type: %s",
value,
type(value),
)
return meta_dict

Expand Down Expand Up @@ -1034,7 +1036,7 @@ def finalize_outputs_pass(
# We should reparse the top-level recipe to get all of our dependencies fixed up.
# we base things on base_metadata because it has the record of the full origin recipe
if base_metadata.config.verbose:
log.info(f"Attempting to finalize metadata for {metadata.name()}")
log.info("Attempting to finalize metadata for %s", metadata.name())
# Using base_metadata is important for keeping the reference to the parent recipe
om = base_metadata.copy()
# other_outputs is the context of what's available for
Expand Down Expand Up @@ -1082,8 +1084,8 @@ def finalize_outputs_pass(
else:
log = utils.get_logger(__name__)
log.warning(
"Could not finalize metadata due to missing dependencies: "
f"{e.packages}"
"Could not finalize metadata due to missing dependencies: %s",
e.packages,
)
outputs[
metadata.name(),
Expand Down Expand Up @@ -1526,7 +1528,7 @@ def get_value(self, name, default=None, autotype=True):
if index is None:
log = utils.get_logger(__name__)
log.warning(
f"No index specified in get_value('{name}'). Assuming index 0."
"No index specified in get_value('%s'). Assuming index 0.", name
)
index = 0

Expand Down Expand Up @@ -3042,8 +3044,9 @@ def _get_used_vars_output_script(self):
else:
log = utils.get_logger(__name__)
log.warning(
f"Not detecting used variables in output script {script}; conda-build only knows "
"how to search .sh and .bat files right now."
"Not detecting used variables in output script %s; conda-build only knows "
"how to search .sh and .bat files right now.",
script,
)
return used_vars

Expand Down
2 changes: 1 addition & 1 deletion conda_build/noarch_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def handle_file(f, d, prefix):
else:
# this should be the built-in logging module, not conda-build's stuff, because this file is standalone.
log = logging.getLogger(__name__)
log.debug(f"Don't know how to handle file: {f}. Including it as-is.")
log.debug("Don't know how to handle file: %s. Including it as-is.", f)


def populate_files(m, files, prefix, entry_point_scripts=None):
Expand Down
6 changes: 4 additions & 2 deletions conda_build/os_utils/macho.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ def find_apple_cctools_executable(name, build_prefix, nofail=False):
except Exception as e:
log = utils.get_logger(__name__)
log.error(
f"ERROR :: Found `{tool}` but is is an Apple Xcode stub executable\n"
f"and it returned an error:\n{e.output}"
"ERROR :: Found `%s` but is is an Apple Xcode stub executable\n"
"and it returned an error:\n%s",
tool,
e.output,
)
raise e
tool = tool_xcr
Expand Down
9 changes: 5 additions & 4 deletions conda_build/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,13 +846,14 @@ def finalize_metadata(
m.final = False
log = utils.get_logger(__name__)
log.warning(
f"Returning non-final recipe for {m.dist()}; one or more dependencies "
"was unsatisfiable:"
"Returning non-final recipe for %s; one or more dependencies "
"was unsatisfiable:",
m.dist(),
)
if build_unsat:
log.warning(f"Build: {build_unsat}")
log.warning("Build: %s", build_unsat)
if host_unsat:
log.warning(f"Host: {host_unsat}")
log.warning("Host: %s", host_unsat)
else:
m.final = True
if is_top_level:
Expand Down
22 changes: 12 additions & 10 deletions conda_build/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def append_hash_to_fn(fn, hash_value):
def download_to_cache(cache_folder, recipe_path, source_dict, verbose=False):
"""Download a source to the local cache."""
if verbose:
log.info(f"Source cache directory is: {cache_folder}")
log.info("Source cache directory is: %s", cache_folder)
if not isdir(cache_folder) and not os.path.islink(cache_folder):
os.makedirs(cache_folder)

Expand All @@ -78,17 +78,19 @@ def download_to_cache(cache_folder, recipe_path, source_dict, verbose=False):
break
else:
log.warning(
f"No hash {ACCEPTED_HASH_TYPES} provided for {unhashed_fn}. Source download forced. "
"Add hash to recipe to use source cache."
"No hash %s provided for %s. Source download forced. "
"Add hash to recipe to use source cache.",
ACCEPTED_HASH_TYPES,
unhashed_fn,
)

path = join(cache_folder, fn)
if isfile(path):
if verbose:
log.info(f"Found source in cache: {fn}")
log.info("Found source in cache: %s", fn)
else:
if verbose:
log.info(f"Downloading source to cache: {fn}")
log.info("Downloading source to cache: %s", fn)

for url in source_urls:
if "://" not in url:
Expand All @@ -102,14 +104,14 @@ def download_to_cache(cache_folder, recipe_path, source_dict, verbose=False):
url = "file:///" + expanduser(url[8:]).replace("\\", "/")
try:
if verbose:
log.info(f"Downloading {url}")
log.info("Downloading %s", url)
with LoggingContext():
download(url, path)
except CondaHTTPError as e:
log.warning(f"Error: {str(e).strip()}")
log.warning("Error: %s", str(e).strip())
rm_rf(path)
except RuntimeError as e:
log.warning(f"Error: {str(e).strip()}")
log.warning("Error: %s", str(e).strip())
rm_rf(path)
else:
if verbose:
Expand Down Expand Up @@ -795,7 +797,7 @@ def _get_patch_attributes(

if not patch_exe:
log.warning(
f"No patch program found, cannot determine patch attributes for {path}"
"No patch program found, cannot determine patch attributes for %s", path
)
if not git:
log.error(
Expand Down Expand Up @@ -944,7 +946,7 @@ def try_apply_patch(patch, patch_args, cwd, stdout, stderr):
try:
try_patch_args = base_patch_args[:]
try_patch_args.append("--dry-run")
log.debug(f"dry-run applying with\n{patch} {try_patch_args}")
log.debug("dry-run applying with\n%s %s", patch, try_patch_args)
check_call_env(
[patch] + try_patch_args, cwd=cwd, stdout=stdout, stderr=stderr
)
Expand Down
Loading
Loading