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

Create a CIBW_ALLOW_EMPTY environment variable for --allow-empty #1922

Closed
ConorMacBride opened this issue Jul 7, 2024 · 1 comment · Fixed by #1937
Closed

Create a CIBW_ALLOW_EMPTY environment variable for --allow-empty #1922

ConorMacBride opened this issue Jul 7, 2024 · 1 comment · Fixed by #1937

Comments

@ConorMacBride
Copy link
Contributor

Description

Would it be possible to enable the CLI flag --allow-empty via an environment variable (e.g., CIBW_ALLOW_EMPTY)?

Here's our use case:

I'm thinking we could compute its value similarly to how CIBW_PRERELEASE_PYTHONS is handled:

prerelease_pythons = args.prerelease_pythons or strtobool(
self.env.get("CIBW_PRERELEASE_PYTHONS", "0")
)

This could be integrated within options.compute_options and added to options.GlobalOptions:

@dataclasses.dataclass(frozen=True)
class GlobalOptions:
package_dir: Path
output_dir: Path
build_selector: BuildSelector
test_selector: TestSelector
architectures: set[Architecture]

Alternatively, CIBW_ALLOW_EMPTY could be checked directly within __main__.py:

if args.allow_empty:
print(f"cibuildwheel: {message}", file=sys.stderr)

I'm happy to open a PR if you think a new environment variable would be appropriate for this option. Thanks!

Build log

No response

CI config

No response

@joerick
Copy link
Contributor

joerick commented Jul 10, 2024

Sounds good! The first implementation idea above makes the most sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants