Skip to content

provide config_setting_group to match any pycross environment#217

Open
tobyh-canva wants to merge 1 commit intojvolkman:mainfrom
tobyh-canva:any-environment-config
Open

provide config_setting_group to match any pycross environment#217
tobyh-canva wants to merge 1 commit intojvolkman:mainfrom
tobyh-canva:any-environment-config

Conversation

@tobyh-canva
Copy link

@tobyh-canva tobyh-canva commented Feb 2, 2026

Context

We have situation in our repo where it'd be really convenient to be able to use select() to choose between "pycross-compatible platforms" and "non-pycross-compatible platforms". Right now, there isn't an easy way to declare this without guess-work and/or duplication of config (at least, not that I'm aware of). An example of a non-pycross-compatible platform in our repo is Android.

Intent

Provide a convenient way to declare compatibility with any platforms which have a corresponding pycross environment configured.

Changes

Introduces a new config_setting_group in the pycross_environments_repo called any_environment, which matches any configured pycross environment.

Example usage

# BUILD.bazel
some_rule(
  name = "some_target",
  target_compatible_with = "@pycross_environments//:any_environment",
)

## Context
We have situation in our repo where it'd be really convenient to be able to use `select()` to choose between "pycross-compatible platforms" and "non-pycross-compatible platforms". Right now, there isn't an easy way to declare this without guess-work and/or duplication of config (at least, not that I'm aware of).

## Intent
Provide and document a convenient way to declare compatibility with any platforms which have a corresponding pycross environment configured.

## Changes
Introduces a new `config_setting_group` in the `pycross_environments_repo` called `any_environment`, which matches any configured pycross environment.

## Example usage

```starlark
# BUILD.bazel
some_rule(
  name = "some_target",
  target_compatible_with = "@pycross_environments//:any_environment",
)
```
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 this pull request may close these issues.

1 participant