fix(python): respect precompiled flavor when excluding freethreaded builds#8745
fix(python): respect precompiled flavor when excluding freethreaded builds#8745
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where Python's freethreaded builds were sometimes incorrectly selected due to a flaw in the flavor-based exclusion logic. The core change ensures that freethreaded builds are only included when explicitly requested by a flavor. Additionally, it enhances the reliability of internal test command execution by standardizing output capture and cleaning, and streamlines test command definitions across various registry entries. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Greptile SummaryThis PR fixes a bug in Python precompiled build selection where specifying any Changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Filter Python build candidates] --> B{Does entry contain 'freethreaded'?}
B -- No --> C[Include entry ✓]
B -- Yes --> D{Is flavor set?}
D -- No --> E[Exclude entry ✗]
D -- Yes --> F{Does flavor contain 'freethreaded'?}
F -- No --> G[Exclude entry ✗\ne.g. install_only_stripped]
F -- Yes --> H[Include entry ✓\ne.g. freethreaded flavor]
Reviews (6): Last reviewed commit: "Merge branch 'main' into fix-python-prec..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request refines test command execution and output processing, and improves Python version filtering logic. Specifically, it updates numerous registry/*.toml files by removing 2>&1 from test commands. In src/cli/test_tool.rs, stderr is now redirected to stdout before output capture, and ANSI escape codes are stripped from test output for more robust matching. Additionally, src/plugins/core/python.rs includes a more precise filtering condition for freethreaded Python builds. The review comments suggest reordering conditions in the Python plugin for improved readability.
3e3ca72 to
b61b4ea
Compare
…uilds Previously, if any flavor was specified (e.g., 'install_only_stripped'), the freethreaded exclusion was skipped, causing 'mise lock' to sometimes pick the freethreaded build incorrectly. Now it only allows freethreaded builds if the requested flavor specifically includes 'freethreaded'. Fixes jdx#8739
b61b4ea to
5dd3600
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refines the filtering logic for Python versions, specifically how 'freethreaded' versions are handled based on the flavor parameter, in both fetch_precompiled_remote_versions and fetch_precompiled_for_target functions within src/plugins/core/python.rs. The review feedback highlights that this updated filtering logic is duplicated across these two functions and suggests extracting it into a private helper function to improve maintainability and prevent future inconsistencies.
Address review feedback by pulling the duplicated logic for matching freethreaded python versions against the requested flavor into a reusable helper.
### 🚀 Features - **(github)** add github_tokens.toml, git credential fill, and `mise github token` command by @jdx in [#8742](#8742) - **(registry)** add tart by @mnm364 in [#8727](#8727) ### 🐛 Bug Fixes - **(python)** respect precompiled flavor when excluding freethreaded builds by @risu729 in [#8745](#8745) - **(shim)** revert shims directory check that caused hangs on macOS by @jdx in [e1b8ca4](e1b8ca4) ### 📚 Documentation - **(python)** swap docs for python.precompiled_arch and python.precompiled_os by @risu729 in [#8744](#8744) ### 🧪 Testing - **(test_tool)** redirect stderr to stdout and strip ansi codes by @risu729 in [#8738](#8738) ### New Contributors - @rtharston made their first contribution in [#8731](#8731)
Previously, if any flavor was specified (e.g., 'install_only_stripped'), the freethreaded exclusion was skipped, causing 'mise lock' to sometimes pick the freethreaded build incorrectly. Now it only allows freethreaded builds if the requested flavor specifically includes 'freethreaded'.
Fixes #8739
This PR was generated by an AI.