From 49791780447d317fd5d71ccb7f026697de080a79 Mon Sep 17 00:00:00 2001 From: Jover Lee Date: Wed, 14 Oct 2026 15:28:59 -0700 Subject: [PATCH] Fix `path_or_url` for wildcard inputs Follow up on We rely on the Snakemake inputs to expand wildcards without threading it through `path_or_url`, so we cannot check the existence of files with wildcards. Remove the check that the local file exists and update warning log with clear hint in case users run into MissingInputException. --- snakemake/remote_files.smk | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/snakemake/remote_files.smk b/snakemake/remote_files.smk index 5c0414d..a6b71e2 100644 --- a/snakemake/remote_files.smk +++ b/snakemake/remote_files.smk @@ -12,6 +12,7 @@ import socket from urllib.parse import urlparse from snakemake.io import get_flag_value, AnnotatedString from snakemake.logging import logger +from textwrap import dedent def is_online(host="8.8.8.8", port=53, timeout=3) -> bool: @@ -228,17 +229,14 @@ def _local_or_storage(wrapped: AnnotatedString) -> str | AnnotatedString: ) return wrapped - local = so.local_path() - if not local.exists(): - raise Exception( - f"Unable to find local cached file for {so.query!r}. " - "Please make sure you have run the workflow at least once with " - "internet connection and config.use_remote_files set to True to " - "to fetch and save the remote file locally.") + local = str(so.local_path()) + logger.warning(dedent(f"""\ + Attempting to use the local file for: - logger.warning( - f"Using the cached copy of {so.query} at {local} without revalidation. " - "Set config.use_remote_files to True if you want to force revalidation." - ) + remote: {so.query} + local: {local} - return str(local) + Set config.use_remote_files to True if you want to force revalidation of the remote file + or if you run into the MissingInputException with the local file. + """)) + return local