Skip to content

Commit

Permalink
feat: empty config-file triggers default behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Oct 22, 2021
1 parent 4f0cf9b commit 816be41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion action.yml
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cibuildwheel/__main__.py
Expand Up @@ -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.
""",
)

Expand Down
5 changes: 3 additions & 2 deletions cibuildwheel/options.py
Expand Up @@ -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
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 816be41

Please sign in to comment.