From 03854036f7182322c52b4cc493241695a3c2dcd7 Mon Sep 17 00:00:00 2001 From: chrysle Date: Sat, 20 Jan 2024 17:44:04 +0100 Subject: [PATCH] Fix config file search and inclusion in header --- piptools/scripts/options.py | 1 + piptools/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/piptools/scripts/options.py b/piptools/scripts/options.py index ab456fce..cae5e2f8 100644 --- a/piptools/scripts/options.py +++ b/piptools/scripts/options.py @@ -245,6 +245,7 @@ def _get_default_option(option_name: str) -> Any: src_files = click.argument( "src_files", nargs=-1, + is_eager=True, type=click.Path(exists=True, allow_dash=True), ) diff --git a/piptools/utils.py b/piptools/utils.py index 3b2061f7..ddbff322 100644 --- a/piptools/utils.py +++ b/piptools/utils.py @@ -630,7 +630,7 @@ def select_config_file(src_files: tuple[str, ...]) -> Path | None: # NOTE: input. working_directory = Path.cwd() src_files_as_paths = ( - (working_directory / src_file).resolve() for src_file in src_files or (".",) + (working_directory / src_file).resolve() for src_file in src_files + (".",) ) candidate_dirs = (src if src.is_dir() else src.parent for src in src_files_as_paths) config_file_path = next(