Skip to content

Conversation

@Hahihula
Copy link
Collaborator

@Hahihula Hahihula commented Nov 4, 2025

now it should be fixed on 3.13 with constatnt in the common library so it should never diverge again

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Centralized Python Version: Introduced a new public constant, PYTHON_NAME_TO_INSTALL, in idf_im_lib::system_dependencies to define the target Python version (3.13) for installation.
  • Unified CLI Prerequisite Installation: Updated the CLI prompt logic in src-tauri/src/cli/prompts.rs to use the new PYTHON_NAME_TO_INSTALL constant when installing Python prerequisites, replacing a hardcoded 'python313'.
  • Unified GUI Prerequisite Installation: Modified the GUI command for Python installation in src-tauri/src/gui/commands/prequisites.rs to also utilize the PYTHON_NAME_TO_INSTALL constant, replacing a hardcoded 'python'.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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()])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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";

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.

2 participants