Skip to content
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

Add flet if no dependencies provided for flet publish command #4508

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
)

def handle(self, options: argparse.Namespace) -> None:
import flet.version
from flet.utils.pip import ensure_flet_web_package_installed

ensure_flet_web_package_installed()
Expand Down Expand Up @@ -197,6 +198,9 @@ def handle(self, options: argparse.Namespace) -> None:
)
print(f"{reqs_filename} dependencies: {deps}")

if len(deps) == 0:
deps = [f"flet=={flet.version.version}"]

temp_reqs_txt = Path(tempfile.gettempdir()).joinpath(random_string(10))
with open(temp_reqs_txt, "w") as f:
f.writelines(dep + "\n" for dep in deps)
Expand Down
1 change: 0 additions & 1 deletion sdk/python/packages/flet/src/flet/cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import subprocess
import sys

import flet.version
from flet.utils.pip import ensure_flet_cli_package_installed


Expand Down