Skip to content

uv: Persist user data#7653

Open
ghyatzo wants to merge 2 commits intoScoopInstaller:masterfrom
ghyatzo:uv-update
Open

uv: Persist user data#7653
ghyatzo wants to merge 2 commits intoScoopInstaller:masterfrom
ghyatzo:uv-update

Conversation

@ghyatzo
Copy link

@ghyatzo ghyatzo commented Feb 18, 2026

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Hey,

This might be a bit opinionated, but I wanted uv to behave like pyenv (when installed through scoop) behaved.
With this change scoops makes uv store its python and tool installation paths within the scoop uv folder.

I currently have been using this manifest for the past year or so without issues regarding uv.

It also automatically sets the python and tool shims folders in the path so that it's automatically available.

If too breaking/opinionated feel free to close, but wanted to give the option if it was ever considered.

Cheers.

Related #6955

@github-actions
Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

uv

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

@ghyatzo ghyatzo changed the title uv@0.10.4: store uv managed artifacts in suv scoop folder uv@0.10.4: store uv managed artifacts in uv scoop folder Feb 18, 2026
@z-Fng
Copy link
Member

z-Fng commented Mar 8, 2026

Should we also migrate the artifacts originally located in $Env:APPDATA/uv to $persist_dir?

@ghyatzo
Copy link
Author

ghyatzo commented Mar 8, 2026

According to https://docs.astral.sh/uv/reference/storage/#tool-executables

I think this manifests already does that by setting all relevant env variables and then save those same folders under persist key.

or maybe I am missing something?

@z-Fng
Copy link
Member

z-Fng commented Mar 8, 2026

I'm referring to users who have previously installed UV via scoop. Their data resides in $Env:APPDATA/uv. After the update, they will 'lose' this data. Should we migrate the data for them, or will UV migrate it automatically?

Main/bucket/bun.json

Lines 26 to 33 in 82c1841

"# Migrate legacy Bun data if it exists and the new persist directory doesn't exist",
"$legacy_bun = Join-Path -Path $env:USERPROFILE -ChildPath '.bun'",
"if ((Test-Path $legacy_bun) -and -not (Test-Path $persist_dir)) {",
" Write-Host \"Migrating legacy Bun data from '$legacy_bun' to '$persist_dir'.\" -ForegroundColor Yellow",
" Move-Item $legacy_bun $persist_dir -Force",
"} elseif ((Test-Path $legacy_bun) -and (Test-Path $persist_dir)) {",
" Write-Host \"Found both '$legacy_bun' and '$persist_dir'. Skipping auto-migration; please migrate manually if needed.\" -ForegroundColor Yellow",
"}",

@ghyatzo
Copy link
Author

ghyatzo commented Mar 8, 2026

Ah that is a very good point.
I believe that uv will redownload the missing python versions on its own the first time that will be needed again. But I don't think it will "reinstall" all the tools's shims automatically. Will need to double check that.

@z-Fng z-Fng changed the title uv@0.10.4: store uv managed artifacts in uv scoop folder uv: Persist user data Mar 9, 2026
@ghyatzo
Copy link
Author

ghyatzo commented Mar 10, 2026

I did some quick tests and uv seems to just pick up whatever is in the target folder. Copying over the legacy location should be a pretty transparent operation for the user.
I'll adapt the bun excerpt shared above to uv as well in the following days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants