diff --git a/action.yml b/action.yml index 3ce3b9dcb..0f294a3e0 100644 --- a/action.yml +++ b/action.yml @@ -12,7 +12,7 @@ inputs: config-file: description: 'File containing the config, defaults to {package}/pyproject.toml' required: false - default: '{package}/pyproject.toml' + default: '' branding: icon: package color: yellow diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index c6a532f95..3b6e3bcdc 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -63,8 +63,8 @@ def main() -> None: parser.add_argument( "--config-file", help=""" - TOML config file for cibuildwheel. Defaults to pyproject.toml, but - can be overridden with this option. + TOML config file for cibuildwheel. If empty, this will use + pyproject.toml if present, but can be overridden with this option. """, ) diff --git a/cibuildwheel/options.py b/cibuildwheel/options.py index 902b64fa5..9a207e9e0 100644 --- a/cibuildwheel/options.py +++ b/cibuildwheel/options.py @@ -42,7 +42,7 @@ class CommandLineArguments: platform: Literal["auto", "linux", "macos", "windows"] archs: Optional[str] output_dir: Optional[str] - config_file: Optional[str] + config_file: str package_dir: str print_build_identifiers: bool allow_empty: bool @@ -335,8 +335,9 @@ def __init__(self, platform: PlatformName, command_line_arguments: CommandLineAr def config_file_path(self) -> Optional[Path]: args = self.command_line_arguments - if args.config_file is not None: + if args.config_file: return Path(args.config_file.format(package=args.package_dir)) + # return pyproject.toml, if it's available pyproject_toml_path = Path(args.package_dir) / "pyproject.toml" if pyproject_toml_path.exists():