fix: add missing config-file option to the action (#883)
* fix: add missing config-file option to the action * feat: empty config-file triggers default behavior * Apply suggestions from code review Co-authored-by: Joe Rickerby <joerick@mac.com> Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
co-authored by
Joe Rickerby
parent
e7da7832ef
commit
12c64365e2
@@ -9,6 +9,10 @@ inputs:
|
|||||||
description: 'Folder to place the outputs in, defaults to "wheelhouse"'
|
description: 'Folder to place the outputs in, defaults to "wheelhouse"'
|
||||||
required: false
|
required: false
|
||||||
default: wheelhouse
|
default: wheelhouse
|
||||||
|
config-file:
|
||||||
|
description: 'File containing the config, defaults to {package}/pyproject.toml'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
branding:
|
branding:
|
||||||
icon: package
|
icon: package
|
||||||
color: yellow
|
color: yellow
|
||||||
@@ -24,5 +28,6 @@ runs:
|
|||||||
cibuildwheel
|
cibuildwheel
|
||||||
${{ inputs.package-dir }}
|
${{ inputs.package-dir }}
|
||||||
--output-dir ${{ inputs.output-dir }}
|
--output-dir ${{ inputs.output-dir }}
|
||||||
|
--config-file "${{ input.config-file }}"
|
||||||
2>&1
|
2>&1
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -57,14 +57,15 @@ def main() -> None:
|
|||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--output-dir",
|
"--output-dir",
|
||||||
help="Destination folder for the wheels.",
|
help="Destination folder for the wheels. Default: wheelhouse.",
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--config-file",
|
"--config-file",
|
||||||
|
default="",
|
||||||
help="""
|
help="""
|
||||||
TOML config file for cibuildwheel. Defaults to pyproject.toml, but
|
TOML config file. Default: "", meaning {package}/pyproject.toml,
|
||||||
can be overridden with this option.
|
if it exists.
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class CommandLineArguments:
|
|||||||
platform: Literal["auto", "linux", "macos", "windows"]
|
platform: Literal["auto", "linux", "macos", "windows"]
|
||||||
archs: Optional[str]
|
archs: Optional[str]
|
||||||
output_dir: Optional[str]
|
output_dir: Optional[str]
|
||||||
config_file: Optional[str]
|
config_file: str
|
||||||
package_dir: str
|
package_dir: str
|
||||||
print_build_identifiers: bool
|
print_build_identifiers: bool
|
||||||
allow_empty: bool
|
allow_empty: bool
|
||||||
@@ -335,8 +335,9 @@ class Options:
|
|||||||
def config_file_path(self) -> Optional[Path]:
|
def config_file_path(self) -> Optional[Path]:
|
||||||
args = self.command_line_arguments
|
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 Path(args.config_file.format(package=args.package_dir))
|
||||||
|
|
||||||
# return pyproject.toml, if it's available
|
# return pyproject.toml, if it's available
|
||||||
pyproject_toml_path = Path(args.package_dir) / "pyproject.toml"
|
pyproject_toml_path = Path(args.package_dir) / "pyproject.toml"
|
||||||
if pyproject_toml_path.exists():
|
if pyproject_toml_path.exists():
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ def get_default_command_line_arguments() -> CommandLineArguments:
|
|||||||
defaults.platform = "auto"
|
defaults.platform = "auto"
|
||||||
defaults.allow_empty = False
|
defaults.allow_empty = False
|
||||||
defaults.archs = None
|
defaults.archs = None
|
||||||
defaults.config_file = None
|
defaults.config_file = ""
|
||||||
defaults.output_dir = None
|
defaults.output_dir = None
|
||||||
defaults.package_dir = "."
|
defaults.package_dir = "."
|
||||||
defaults.prerelease_pythons = False
|
defaults.prerelease_pythons = False
|
||||||
|
|||||||
Reference in New Issue
Block a user