Skip to content

Commit 4b7e0be

Browse files
committed
feat: empty config-file triggers default behavior
1 parent 4f0cf9b commit 4b7e0be

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inputs:
1212
config-file:
1313
description: 'File containing the config, defaults to {package}/pyproject.toml'
1414
required: false
15-
default: '{package}/pyproject.toml'
15+
default: ''
1616
branding:
1717
icon: package
1818
color: yellow

cibuildwheel/__main__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ def main() -> None:
5757

5858
parser.add_argument(
5959
"--output-dir",
60-
help="Destination folder for the wheels.",
60+
help="Destination folder for the wheels. Default: wheelhouse.",
6161
)
6262

6363
parser.add_argument(
6464
"--config-file",
65+
default="",
6566
help="""
66-
TOML config file for cibuildwheel. Defaults to pyproject.toml, but
67-
can be overridden with this option.
67+
TOML config file for cibuildwheel. If empty, this will use
68+
{package}/pyproject.toml, but will not error if it is missing.
6869
""",
6970
)
7071

cibuildwheel/options.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CommandLineArguments:
4242
platform: Literal["auto", "linux", "macos", "windows"]
4343
archs: Optional[str]
4444
output_dir: Optional[str]
45-
config_file: Optional[str]
45+
config_file: str
4646
package_dir: str
4747
print_build_identifiers: bool
4848
allow_empty: bool
@@ -335,8 +335,9 @@ def __init__(self, platform: PlatformName, command_line_arguments: CommandLineAr
335335
def config_file_path(self) -> Optional[Path]:
336336
args = self.command_line_arguments
337337

338-
if args.config_file is not None:
338+
if args.config_file:
339339
return Path(args.config_file.format(package=args.package_dir))
340+
340341
# return pyproject.toml, if it's available
341342
pyproject_toml_path = Path(args.package_dir) / "pyproject.toml"
342343
if pyproject_toml_path.exists():

unit_test/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def get_default_command_line_arguments() -> CommandLineArguments:
77
defaults.platform = "auto"
88
defaults.allow_empty = False
99
defaults.archs = None
10-
defaults.config_file = None
10+
defaults.config_file = ""
1111
defaults.output_dir = None
1212
defaults.package_dir = "."
1313
defaults.prerelease_pythons = False

0 commit comments

Comments
 (0)