diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5ef735..3a129b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,6 @@ defaults: shell: "pwsh" env: UV_CACHE_DIR: ".cache/uv" - UV_SYSTEM_PYTHON: "true" jobs: sync: strategy: diff --git a/.github/workflows/high.yml b/.github/workflows/high.yml index ff9ed65..92f987d 100644 --- a/.github/workflows/high.yml +++ b/.github/workflows/high.yml @@ -9,7 +9,6 @@ defaults: shell: "pwsh" env: UV_CACHE_DIR: ".cache/uv" - UV_SYSTEM_PYTHON: "true" SYNC_PY_HIGH: "true" jobs: sync: diff --git a/scripts/Common.ps1 b/scripts/Common.ps1 index 914346e..d9b9a45 100644 --- a/scripts/Common.ps1 +++ b/scripts/Common.ps1 @@ -44,13 +44,18 @@ function Sync-Uv { if (Get-Command 'uv' -ErrorAction 'Ignore') { $Uv = 'uv' } else { $Uv = Get-Item 'bin/uv.???' -ErrorAction 'Ignore' - # ? Prepend local `bin` to PATH - if (!($Bin = Get-Item 'bin' -ErrorAction 'Ignore')) { - New-Item 'bin' -ItemType 'Directory' - } - $Sep = $IsWindows ? ';' : ':' - $Env:PATH = "$(Get-Item 'bin')$Sep$Env:PATH" } + # ? Prepend local `bin` to PATH + if (!($Bin = Get-Item 'bin' -ErrorAction 'Ignore')) { + New-Item 'bin' -ItemType 'Directory' + $Bin = Get-Item 'bin' + } + $Sep = $IsWindows ? ';' : ':' + $Env:PATH = "$(Get-Item 'bin')$Sep$Env:PATH" + if ($CI) { + ("PATH=$Bin$Sep$Env:PATH", "UV_TOOL_BIN_DIR=$Bin") | Add-Content $EnvFile + } + # ? if ((!$Uv -or !(& $Uv --version | Select-String $Version))) { 'Installing uv' | Write-Progress $OrigCargoHome = $Env:CARGO_HOME diff --git a/scripts/Initialize-Shell.ps1 b/scripts/Initialize-Shell.ps1 index c698153..ce430fd 100644 --- a/scripts/Initialize-Shell.ps1 +++ b/scripts/Initialize-Shell.ps1 @@ -40,7 +40,8 @@ function Set-Env { } if (!(Get-Command 'context_models_tools' -ErrorAction 'Ignore')) { 'Installing tools' | Write-Progress - uv tool install --python $Version --resolution 'lowest-direct' 'scripts/.' + $Env:UV_TOOL_BIN_DIR = Get-Item 'bin' + uv tool install --force --python $Version --resolution 'lowest-direct' 'scripts/.' 'Tools installed' | Write-Progress -Done } @@ -72,7 +73,6 @@ function Set-Env { } } @($Lines, $NewLines) | Set-Content $EnvFile - if ($CI) {"PATH=$(Get-Item 'bin')$Sep$Env:PATH" | Add-Content $EnvFile} } Set-Env diff --git a/scripts/Sync-Py.ps1 b/scripts/Sync-Py.ps1 index 7517454..ba4420f 100644 --- a/scripts/Sync-Py.ps1 +++ b/scripts/Sync-Py.ps1 @@ -18,10 +18,9 @@ Param( $High = $High ? $High : [bool]$Env:SYNC_PY_HIGH $CI = $Env:SYNC_PY_DISABLE_CI ? $null : $Env:CI $Devcontainer = $Env:SYNC_PY_DISABLE_DEVCONTAINER ? $null : $Env:DEVCONTAINER -$Env:UV_SYSTEM_PYTHON = $CI ? 'true' : $null if (!$Release -and $CI) { $msg = 'CI' } elseif ($Devcontainer) { $msg = 'devcontainer' } -elseif ($Release) {$msg = 'release'} +elseif ($Release) { $msg = 'release' } "Will run $msg steps" | Write-Progress -Info if ($Release) { diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 588c97a..f94a95f 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "toml==0.10.2 ; python_version < '3.11'", ] [project.scripts] -"context_models-tools" = "context_models_tools.__main__:main" +"context-models-tools" = "context_models_tools.__main__:main" "context_models_tools" = "context_models_tools.__main__:main" [tool.fawltydeps]