Skip to content

Commit 23dae41

Browse files
committed
uv: use inline scripting
1 parent c739fb2 commit 23dae41

File tree

6 files changed

+33
-13
lines changed

6 files changed

+33
-13
lines changed

.appveyor.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ for:
139139
# patch pubspecs
140140
for dir in packages/flet*; do
141141
echo "Patching $dir/pubspec.yaml"
142-
uv run --with pyyaml ci/patch_pubspec.py $dir/pubspec.yaml $PKG_VER
142+
uv run ci/patch_pubspec.py $dir/pubspec.yaml $PKG_VER
143143
done
144144
145145
cd packages/flet
@@ -209,7 +209,7 @@ for:
209209
$ErrorActionPreference = "Stop"
210210
$env:PYPI_VER = $env:APPVEYOR_BUILD_VERSION.replace("+", ".dev")
211211
$vp = "$env:flet_sdk_root/packages/flet-desktop/src/flet_desktop/version.py"; (Get-Content $vp).replace("version = `"`"", "version = `"$env:PYPI_VER`"") | Set-Content $vp
212-
- uv run --with tomlkit ci/patch_toml_versions.py %flet_sdk_root%/packages/flet-desktop/pyproject.toml %PYPI_VER%
212+
- uv run ci/patch_toml_versions.py %flet_sdk_root%/packages/flet-desktop/pyproject.toml %PYPI_VER%
213213

214214
- cd client
215215
- set RELEASE_DIR=build\windows\x64\runner\Release
@@ -230,8 +230,8 @@ for:
230230
- uv build --wheel --package flet-desktop
231231
- ps: |
232232
Get-ChildItem -Path dist/*-py3-none-any.whl | ForEach-Object {
233-
Start-ProcessWithOutput "uv run --with wheel --no-project $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win_amd64"
234-
Start-ProcessWithOutput "uv run --with wheel --no-project $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win32"
233+
Start-ProcessWithOutput "uv run $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win_amd64"
234+
Start-ProcessWithOutput "uv run $env:APPVEYOR_BUILD_FOLDER\ci\repackage_wheel_with_tag.py $($_.FullName) py3-none-win32"
235235
Remove-Item $_.FullName
236236
}
237237
- dir dist
@@ -291,8 +291,8 @@ for:
291291
- uv build --wheel --package flet-desktop
292292
- sh: |
293293
for file in dist/*-py3-none-any.whl; do
294-
uv run --with wheel --no-project $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_12_0_arm64"
295-
uv run --with wheel --no-project $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_10_14_x86_64"
294+
uv run $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_12_0_arm64"
295+
uv run $root/ci/repackage_wheel_with_tag.py $file "py3-none-macosx_10_14_x86_64"
296296
rm $file
297297
done
298298
@@ -378,7 +378,7 @@ for:
378378
for file in dist/*-py3-none-any.whl; do
379379
for tag in "${wheel_tags[@]}"; do
380380
wheel_tag=$(echo "$tag" | sed "s/{arch}/$platform_arch/g")
381-
uv run --with wheel --no-project $root/ci/repackage_wheel_with_tag.py $file $wheel_tag
381+
uv run $root/ci/repackage_wheel_with_tag.py $file $wheel_tag
382382
done
383383
rm "$file"
384384
done
@@ -488,7 +488,7 @@ for:
488488
- uv build --wheel --package flet
489489

490490
# update deps
491-
- uv run --with wheel $root/ci/update-flet-wheel-deps.py dist
491+
- uv run $root/ci/update-flet-wheel-deps.py dist
492492

493493
# publish packages
494494
- publish_to_pypi dist/*.whl

ci/patch_pubspec.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["pyyaml"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -17,7 +21,7 @@
1721
"flet",
1822
]
1923

20-
with open(pubspec_path, "r") as f:
24+
with open(pubspec_path) as f:
2125
data = yaml.safe_load(f)
2226

2327
# patch version

ci/patch_toml_package_name.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["tomlkit"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -14,7 +18,7 @@
1418
print(f"Patching TOML file {toml_path} to {package_name}")
1519

1620
# read
17-
with open(toml_path, "r") as f:
21+
with open(toml_path) as f:
1822
t = tomlkit.parse(f.read())
1923

2024
# patch name

ci/patch_toml_versions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["tomlkit"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -14,7 +18,7 @@
1418
print(f"Patching TOML file {toml_path} to {ver}")
1519

1620
# read
17-
with open(toml_path, "r") as f:
21+
with open(toml_path) as f:
1822
t = tomlkit.parse(f.read())
1923

2024
# patch version

ci/repackage_wheel_with_tag.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["wheel"]
3+
# ///
4+
15
import os
26
import sys
37
import tempfile
@@ -38,7 +42,7 @@ def repackage_wheel(wheel_path, new_tag):
3842
# Process metadata files and replace the tag
3943
metadata_files = list(wheel_dir.glob("*.dist-info/WHEEL"))
4044
for metadata_file in metadata_files:
41-
with open(metadata_file, "r") as f:
45+
with open(metadata_file) as f:
4246
content = f.read()
4347
new_content = content.replace(
4448
"Tag: py3-none-any",

ci/update-flet-wheel-deps.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["wheel"]
3+
# ///
4+
15
import os
26
import re
37
import sys
@@ -27,7 +31,7 @@ def extract_version(wheel_file):
2731

2832
# Process the METADATA file
2933
def update_metadata(metadata_file, version):
30-
with open(metadata_file, "r") as file:
34+
with open(metadata_file) as file:
3135
lines = file.readlines()
3236

3337
i = 0

0 commit comments

Comments
 (0)