fix support multiple values for python-platform #3440#3467
Open
asukaminato0721 wants to merge 6 commits into
Open
fix support multiple values for python-platform #3440#3467asukaminato0721 wants to merge 6 commits into
asukaminato0721 wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for specifying multiple python-platform values (and an "all" option) so Pyrefly can avoid incorrectly pruning platform-gated branches when code is intended to run across multiple OS targets.
Changes:
- Update
PythonPlatformto representallor a normalized set of platforms, with serde support for string-or-list config values. - Extend
SysInfoexpression evaluation sosys.platform/os.namecomparisons can produce “unknown” results when multiple platforms are possible, plus add unit tests for these cases. - Update user docs and JSON schema to reflect the expanded
python-platformconfiguration surface.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| website/docs/configuration.mdx | Documents python-platform as string-or-list and introduces "all" semantics. |
| schemas/pyrefly.json | Allows python-platform to be either a string or a non-empty array of strings. |
| crates/pyrefly_python/src/sys_info.rs | Implements multi-platform/all semantics in PythonPlatform and updates condition evaluation accordingly, with new tests. |
| crates/pyrefly_config/src/config.rs | Adds config parsing tests for list and "all" values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yangdanny97
reviewed
May 19, 2026
connernilsen
requested changes
May 20, 2026
Contributor
connernilsen
left a comment
There was a problem hiding this comment.
Hey Asuka, thanks for making this. I have a few changes, but a few questions remain on some of the implementation details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3440
PythonPlatform now can represent one platform, multiple platforms, or all.
Platform checks now only fold to true/false when all configured platforms agree; mixed results stay unknown so both branches are type checked.
Test Plan
add test