-
Notifications
You must be signed in to change notification settings - Fork 2
EIM-350 unify which version of python gets installed as part of install prerequisities on windows #261
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
base: master
Are you sure you want to change the base?
Conversation
…ll prerequisities on windows
Summary of ChangesHello @Hahihula, 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 standardizes the Python version installed as a prerequisite on Windows by centralizing its definition into a single, shared constant. This change ensures that all parts of the application responsible for installing Python consistently target version 3.13, preventing potential version discrepancies and simplifying future updates. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request unifies the Python version installed as a prerequisite on Windows by introducing a constant, PYTHON_NAME_TO_INSTALL. This is a positive change that improves maintainability and fixes an inconsistency where different parts of the application could attempt to install different Python versions. My review includes suggestions to add documentation for the new constant and to address a potential issue with a hardcoded Python executable name that could cause problems in the future.
|
|
||
| if res.map_err(|e| e.to_string())? { | ||
| system_dependencies::install_prerequisites(vec!["python313".to_string()]) | ||
| system_dependencies::install_prerequisites(vec![idf_im_lib::system_dependencies::PYTHON_NAME_TO_INSTALL.to_string()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a constant here is a great improvement for maintainability. However, there's a potential issue that this change highlights. Later in this function, the Python executable is hardcoded as python3.exe (on lines 153 and 159). While this works for python313, if PYTHON_NAME_TO_INSTALL is ever changed to a package that doesn't provide a python3.exe shim (e.g., an older Python 2 version), the installation will succeed but the subsequent sanity check will fail. To make this more robust, it would be ideal to also have a constant for the expected executable name, or derive it from PYTHON_NAME_TO_INSTALL.
|
|
||
| use crate::{command_executor, utils::find_by_name_and_extension}; | ||
|
|
||
| pub const PYTHON_NAME_TO_INSTALL: &str = "python313"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good to have this constant. To improve clarity and prevent future misuse, please consider adding a doc comment explaining what this constant represents (e.g., the name of the Python package to install via Scoop on Windows) and the expected format of the value.
| pub const PYTHON_NAME_TO_INSTALL: &str = "python313"; | |
| /// The name of the Python package to install via Scoop on Windows. | |
| pub const PYTHON_NAME_TO_INSTALL: &str = "python313"; |
now it should be fixed on 3.13 with constatnt in the common library so it should never diverge again