Skip to content

Conversation

@FeodorFitsner
Copy link
Contributor

@FeodorFitsner FeodorFitsner commented Jan 20, 2026

Summary by Sourcery

Add flexible runtime package installation using either pip or uv and expose the current platform to project templates.

New Features:

  • Allow runtime installation of Flet packages via uv with pip as a fallback or alternative depending on environment configuration.
  • Expose the current operating system as a platform variable to Flet project templates created via the CLI.

Enhancements:

  • Improve installation error messaging to suggest both pip and uv upgrade commands when package installation fails.

Refactored install_flet_package to try installing with uv if the UV environment variable is set, falling back to pip if uv is unavailable, and vice versa. Added helper functions for pip and uv installation, improved error handling, and updated user messages to reflect both installation methods.
Introduced detection of the current OS platform using the platform module and added it to the template_data dictionary. This allows templates to access the platform name for platform-specific logic or file generation.
@FeodorFitsner FeodorFitsner merged commit 6cfccb7 into main Jan 20, 2026
26 of 27 checks passed
@FeodorFitsner FeodorFitsner deleted the flet-tool branch January 20, 2026 03:51
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

Comment on lines +13 to 16
return subprocess.call(
[
sys.executable,
"-m",
Copy link
Contributor

Choose a reason for hiding this comment

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

security (python.lang.security.audit.dangerous-subprocess-use-audit): Detected subprocess function 'call' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'.

Source: opengrep

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