Skip to content

Commit e85ebfe

Browse files
committed
Always use active env in uv run
1 parent cb5ed55 commit e85ebfe

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

scripts/build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
& "$PSScriptRoot/compile_resources.ps1"
22

3-
$SupportsSplashScreen = [System.Convert]::ToBoolean($(uv run python -c "import _tkinter; print(hasattr(_tkinter, '__file__'))"))
3+
$SupportsSplashScreen = [System.Convert]::ToBoolean($(uv run --active python -c "import _tkinter; print(hasattr(_tkinter, '__file__'))"))
44

55
$arguments = @(
66
"$PSScriptRoot/../src/AutoSplit.py",
@@ -18,7 +18,7 @@ if ($IsWindows) {
1818
'--hidden-import=winrt.windows.foundation')
1919
}
2020

21-
Start-Process -Wait -NoNewWindow uv -ArgumentList $(@('run', 'pyinstaller') + $arguments)
21+
Start-Process -Wait -NoNewWindow uv -ArgumentList $(@('run', '--active', 'pyinstaller') + $arguments)
2222

2323
If ($IsLinux) {
2424
Move-Item -Force $PSScriptRoot/../dist/AutoSplit $PSScriptRoot/../dist/AutoSplit.elf

scripts/compile_resources.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Set-Location "$PSScriptRoot/.."
33

44
New-Item ./src/gen -ItemType directory -Force | Out-Null
55
New-Item ./src/gen/__init__.py -ItemType File -Force | Out-Null
6-
uv run pyside6-uic './res/about.ui' -o './src/gen/about.py'
7-
uv run pyside6-uic './res/design.ui' -o './src/gen/design.py'
8-
uv run pyside6-uic './res/settings.ui' -o './src/gen/settings.py'
9-
uv run pyside6-uic './res/update_checker.ui' -o './src/gen/update_checker.py'
10-
uv run pyside6-rcc './res/resources.qrc' -o './src/gen/resources_rc.py'
6+
uv run --active pyside6-uic './res/about.ui' -o './src/gen/about.py'
7+
uv run --active pyside6-uic './res/design.ui' -o './src/gen/design.py'
8+
uv run --active pyside6-uic './res/settings.ui' -o './src/gen/settings.py'
9+
uv run --active pyside6-uic './res/update_checker.ui' -o './src/gen/update_checker.py'
10+
uv run --active pyside6-rcc './res/resources.qrc' -o './src/gen/resources_rc.py'
1111
$files = Get-ChildItem ./src/gen/ *.py
1212
foreach ($file in $files) {
1313
(Get-Content $file.PSPath) |

scripts/designer.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$qt6_applications_path = uv run python -c 'import qt6_applications; print(qt6_applications.__path__[0])'
1+
$qt6_applications_path = uv run --active python -c 'import qt6_applications; print(qt6_applications.__path__[0])'
22

33
& "$qt6_applications_path/Qt/bin/designer" `
44
"$PSScriptRoot/../res/design.ui" `

scripts/install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ If ($IsLinux) {
3232
If (-not $Env:GITHUB_JOB -or $Env:GITHUB_JOB -eq 'Build') {
3333
sudo apt-get update
3434
# python3-tk for splash screen, libxcb-cursor-dev for QT_QPA_PLATFORM=xcb, the rest for PySide6
35-
sudo apt-get install -y python3-tk libxcb-cursor-dev libegl1 libxkbcommon0
35+
sudo apt-get install -y python3-tk libxcb-cursor-dev libegl1 libxkbcommon0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-keysyms1
3636
}
3737
}
3838

3939
$prod = If ($Env:GITHUB_JOB -eq 'Build') { '--no-dev' } Else { }
4040
$lock = If ($Env:GITHUB_JOB) { '--locked' } Else { '--upgrade' }
4141
Write-Output "Installing Python dependencies with: uv sync $prod $lock"
42-
uv sync $prod $lock
42+
uv sync --active $prod $lock
4343

4444
# Don't compile resources on the Build CI job as it'll do so in build script
4545
If (-not $prod) {

scripts/lint.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Set-Location "$PSScriptRoot/.."
33
$exitCodes = 0
44

55
Write-Host "`nRunning Ruff check ..."
6-
uv run ruff check --fix
6+
uv run --active ruff check --fix
77
$exitCodes += $LastExitCode
88
if ($LastExitCode -gt 0) {
99
Write-Host "`Ruff failed ($LastExitCode)" -ForegroundColor Red
@@ -13,12 +13,12 @@ else {
1313
}
1414

1515
Write-Host "`nRunning Ruff format ..."
16-
uv run ruff format
16+
uv run --active ruff format
1717

18-
$pyrightVersion = $(uv run pyright --version).replace('pyright ', '')
18+
$pyrightVersion = $(uv run --active pyright --version).replace('pyright ', '')
1919
Write-Host "`nRunning Pyright $pyrightVersion ..."
2020
$Env:PYRIGHT_PYTHON_FORCE_VERSION = $pyrightVersion
21-
uv run pyright src/
21+
uv run --active pyright src/
2222
$exitCodes += $LastExitCode
2323
if ($LastExitCode -gt 0) {
2424
Write-Host "`Pyright failed ($LastExitCode)" -ForegroundColor Red

scripts/start.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
param ([string]$p1)
22
& "$PSScriptRoot/compile_resources.ps1"
3-
uv run "$PSScriptRoot/../src/AutoSplit.py" $p1
3+
uv run --active "$PSScriptRoot/../src/AutoSplit.py" $p1

0 commit comments

Comments
 (0)