Skip to content

Commit cc998cd

Browse files
Merge flet-core into flet, flet package extras (#4251)
* Merge flet_core into flet * Reformat __init__ * Fix logger * inroduce Flet extras * Fix tests and some imports * Fix tests * Update markers, create flet.cli redirect * Fix PubSubHub references * On-demand install flet packages * Fix verson in dependent packages * Complete merge of main * Fix deprecated enum metaclasses * Fix tests
1 parent 93cce26 commit cc998cd

File tree

284 files changed

+2866
-2198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+2866
-2198
lines changed

.appveyor.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,8 @@ for:
199199
- ps: |
200200
$ErrorActionPreference = "Stop"
201201
$env:PYPI_VER = $env:APPVEYOR_BUILD_VERSION.replace("+", ".dev")
202-
$vp = "$env:flet_sdk_root/packages/flet-core/src/flet_core/version.py"; (Get-Content $vp).replace("version = `"`"", "version = `"$env:PYPI_VER`"") | Set-Content $vp
202+
$vp = "$env:flet_sdk_root/packages/flet/src/flet/version.py"; (Get-Content $vp).replace("version = `"`"", "version = `"$env:PYPI_VER`"") | Set-Content $vp
203203
- python ci/patch_toml_versions.py %flet_sdk_root%/packages/flet-desktop/pyproject.toml %PYPI_VER%
204-
- python ci/patch_toml_versions.py %flet_sdk_root%/packages/flet-core/pyproject.toml %PYPI_VER%
205204

206205
- cd client
207206
- set RELEASE_DIR=build\windows\x64\runner\Release
@@ -491,11 +490,6 @@ for:
491490
- cd $flet_sdk_root
492491
- poetry install
493492

494-
# build "flet-core" package
495-
- pushd packages/flet-core
496-
- poetry build
497-
- popd
498-
499493
# build "flet-cli" package
500494
- pushd packages/flet-cli
501495
- poetry build
@@ -510,11 +504,9 @@ for:
510504
# publish package
511505
- |
512506
publish_to_pypi \
513-
packages/flet-core/dist/*.whl \
514507
packages/flet-cli/dist/*.whl \
515508
packages/flet/dist/*.whl
516509
517510
artifacts:
518-
- path: sdk/python/packages/flet-core/dist/*
519511
- path: sdk/python/packages/flet-cli/dist/*
520512
- path: sdk/python/packages/flet/dist/*

ci/clean-pypi.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#VER="0\.22\.0\.dev"
33
#VER="0\.21\.1"
44
pypi-cleanup -u flet -p flet -y -r $VER --do-it
5-
pypi-cleanup -u flet -p flet-core -y -r $VER --do-it
6-
pypi-cleanup -u flet -p flet-runtime -y -r $VER --do-it
7-
pypi-cleanup -u flet -p flet-embed -y -r $VER --do-it
8-
pypi-cleanup -u flet -p flet-pyodide -y -r $VER --do-it
5+
pypi-cleanup -u flet -p flet-cli -y -r $VER --do-it
6+
pypi-cleanup -u flet -p flet-desktop -y -r $VER --do-it
7+
pypi-cleanup -u flet -p flet-web -y -r $VER --do-it

ci/common.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ pip install --upgrade setuptools wheel twine poetry tomlkit virtualenv
77

88
function patch_python_package_versions() {
99
PYPI_VER="${APPVEYOR_BUILD_VERSION/+/.dev}"
10-
sed -i -e "s/version = \"\"/version = \"$PYPI_VER\"/g" $flet_sdk_root/packages/flet-core/src/flet_core/version.py
10+
sed -i -e "s/version = \"\"/version = \"$PYPI_VER\"/g" $flet_sdk_root/packages/flet/src/flet/version.py
1111
python3 $root/ci/patch_toml_versions.py $flet_sdk_root/packages/flet/pyproject.toml $PYPI_VER
1212
python3 $root/ci/patch_toml_versions.py $flet_sdk_root/packages/flet-cli/pyproject.toml $PYPI_VER
13-
python3 $root/ci/patch_toml_versions.py $flet_sdk_root/packages/flet-core/pyproject.toml $PYPI_VER
1413
python3 $root/ci/patch_toml_versions.py $flet_sdk_root/packages/flet-desktop/pyproject.toml $PYPI_VER
1514
python3 $root/ci/patch_toml_versions.py $flet_sdk_root/packages/flet-web/pyproject.toml $PYPI_VER
1615
}

ci/patch_toml_versions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def patch_dep(dep_name):
3232
deps[dep_name] = ver
3333

3434

35-
patch_dep("flet-core")
3635
patch_dep("flet-cli")
3736
patch_dep("flet-desktop")
3837
patch_dep("flet-web")

ci/update-flet-wheel-deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def update_metadata(metadata_file, version):
3838
if lines[i].startswith("Requires-Dist: flet-desktop "):
3939
lines.insert(
4040
i + 1,
41-
f"Requires-Dist: flet-desktop-light (=={version}) ; platform_system == 'Linux' and 'embedded' not in platform_version\n",
41+
f'Requires-Dist: flet-desktop-light (=={version}) ; platform_system == "Linux" and (extra == "all" or extra == "desktop")\n',
4242
)
4343
lines[i] = re.sub(
4444
r'platform_system != "desktop-light"',

sdk/python/packages/flet-cli/pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ documentation = "https://flet.dev/docs"
1515

1616
[tool.poetry.dependencies]
1717
python = "^3.8"
18+
flet = { version = "0.1.0" }
1819
watchdog = "^4.0.0"
1920
packaging = "*"
2021
qrcode = "^7.4.2"
2122
toml = "^0.10.2"
2223
cookiecutter = "^2.6.0"
2324

25+
[tool.poetry.scripts]
26+
flet = "flet_cli.cli:main"
27+
28+
[tool.poetry.plugins."pyinstaller40"]
29+
hook-dirs = "flet_cli.__pyinstaller:get_hook_dirs"
30+
2431
[build-system]
2532
requires = ["poetry-core"]
2633
build-backend = "poetry.core.masonry.api"

sdk/python/packages/flet-cli/src/flet_cli/__pyinstaller/macos_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import tarfile
66
from pathlib import Path
77

8-
from flet_core.utils import safe_tar_extractall
8+
from flet.utils import safe_tar_extractall
99
from PyInstaller.building.icon import normalize_icon_type
1010

1111

sdk/python/packages/flet-cli/src/flet_cli/__pyinstaller/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import uuid
44
from pathlib import Path
55

6-
from flet_core.utils import copy_tree
6+
from flet.utils import copy_tree
77
from flet_desktop import get_package_bin_dir
88

99

sdk/python/packages/flet-cli/src/flet_cli/commands/build.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import argparse
22
import glob
3-
import json
43
import os
54
import platform
65
import re
@@ -13,16 +12,15 @@
1312
import flet.version
1413
import toml
1514
import yaml
15+
from flet.utils import copy_tree, is_windows, slugify
16+
from flet.utils.platform_utils import get_bool_env_var
1617
from flet.version import update_version
17-
from flet_core.utils import copy_tree, is_windows, slugify
18-
from flet_core.utils.platform_utils import get_bool_env_var
18+
from flet_cli.commands.base import BaseCommand
19+
from flet_cli.utils.merge import merge_dict
1920
from packaging import version
2021
from rich.console import Console, Style
2122
from rich.table import Column, Table
2223

23-
from flet_cli.commands.base import BaseCommand
24-
from flet_cli.utils.merge import merge_dict
25-
2624
if is_windows():
2725
from ctypes import windll
2826

sdk/python/packages/flet-cli/src/flet_cli/commands/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from pathlib import Path
44

55
import flet.version
6+
from flet.utils import slugify
67
from flet_cli.commands.base import BaseCommand
7-
from flet_core.utils import slugify
88
from packaging import version
99
from rich import print
1010

0 commit comments

Comments
 (0)