Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing config-file option to the action #883

Merged
merged 3 commits into from Oct 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions action.yml
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Folder to place the outputs in, defaults to "wheelhouse"'
required: false
default: wheelhouse
config-file:
description: 'File containing the config, defaults to {package}/pyproject.toml'
required: false
default: ''
branding:
icon: package
color: yellow
Expand All @@ -24,5 +28,6 @@ runs:
cibuildwheel
${{ inputs.package-dir }}
--output-dir ${{ inputs.output-dir }}
--config-file ${{ input.config-file }}
henryiii marked this conversation as resolved.
Show resolved Hide resolved
2>&1
shell: bash
7 changes: 4 additions & 3 deletions cibuildwheel/__main__.py
Expand Up @@ -57,14 +57,15 @@ def main() -> None:

parser.add_argument(
"--output-dir",
help="Destination folder for the wheels.",
help="Destination folder for the wheels. Default: wheelhouse.",
)

parser.add_argument(
"--config-file",
default="",
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
{package}/pyproject.toml, but will not error if it is missing.
henryiii marked this conversation as resolved.
Show resolved Hide resolved
""",
)

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
2 changes: 1 addition & 1 deletion unit_test/utils.py
Expand Up @@ -7,7 +7,7 @@ def get_default_command_line_arguments() -> CommandLineArguments:
defaults.platform = "auto"
defaults.allow_empty = False
defaults.archs = None
defaults.config_file = None
defaults.config_file = ""
defaults.output_dir = None
defaults.package_dir = "."
defaults.prerelease_pythons = False
Expand Down