Skip to content

Comments

Add a "storage" reference document#15954

Merged
zsol merged 8 commits intomainfrom
zsol/storage-docs
Nov 17, 2025
Merged

Add a "storage" reference document#15954
zsol merged 8 commits intomainfrom
zsol/storage-docs

Conversation

@zsol
Copy link
Member

@zsol zsol commented Sep 19, 2025

This is based on, and supersedes @zanieb's #13976

@zsol zsol requested a review from zanieb September 19, 2025 20:22
@zsol zsol force-pushed the zsol/storage-docs branch from fbe2564 to 8457437 Compare September 19, 2025 20:26
@zsol zsol marked this pull request as ready for review September 19, 2025 20:28
@zsol zsol added the documentation Improvements or additions to documentation label Sep 19, 2025
@zsol zsol marked this pull request as draft September 19, 2025 20:29
@zsol zsol force-pushed the zsol/storage-docs branch from 8457437 to 2a1effb Compare September 19, 2025 20:33
@zsol zsol marked this pull request as ready for review September 19, 2025 20:34
@zanieb zanieb self-assigned this Sep 20, 2025
@zsol zsol force-pushed the zsol/storage-docs branch 2 times, most recently from 1df95e2 to 74ab526 Compare November 2, 2025 03:55
@zsol zsol force-pushed the zsol/storage-docs branch from 74ab526 to 59fac59 Compare November 2, 2025 03:57
@zsol
Copy link
Member Author

zsol commented Nov 2, 2025

Thanks for all the feedback. I've rewritten the first section (directory strategies) based on it, including the excellent table @konstin mentioned, extending it a bit. I think the page is now more concise, less repetitive.

After some digging, I now think that .uv in the current directory is technically a fallback in the code, I think that branch is unreachable because uv_dirs::user_state_dir() always returns an Ok value, so I removed that bit from the docs. We should get rid of it from the code, too, IMO.

@konstin
Copy link
Member

konstin commented Nov 4, 2025

After some digging, I now think that .uv in the current directory is technically a fallback in the code, I think that branch is unreachable because uv_dirs::user_state_dir() always returns an Ok value, so I removed that bit from the docs. We should get rid of it from the code, too, IMO.

The code can fail if there's a HomeDirError cause the home dir function is fallible. From my experience there's always some minimal Docker or some Windows entreprise configuration where it fails, so a .uv fallback is convenient.

| Purpose | Unix Default | Windows Default |
| -------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------- |
| Temporary files and caches | `$XDG_CACHE_HOME/uv` or `~/.cache/uv` as a fallback | `%LOCALAPPDATA%\uv\cache` |
| Persistent data | `$XDG_DATA_HOME/uv` or `~/.local/share/uv` as a fallback | `%APPDATA%\uv\data` if exists, otherwise `%APPDATA%\uv` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a fresh install, it uses %APPDATA%\uv to e.g. install Pythons, we should document that as default location, the %APPDATA%\uv\data exists only not to break legacy paths.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Do you think it's important to emphasize this nuance here? I think what the PR has currently is correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd document where a user can expect their data to go, and which levers they have to change this. So I'd put %APPDATA%\uvcentrally: It's the location to find uv data, and changing APPDATA can change the location of uv data. %APPDATA%\uv\data should be more akin to a footnote, it something that may be used on a legacy setup, but never when setting something new up, or when changing the location manually. Currently, it reads to me as if %APPDATA%\uv\data is the main one, and %APPDATA%\uv is a fallback.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, changed it. PTAL

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I omitted the legacy location entirely, that's really old functionality.

@zsol
Copy link
Member Author

zsol commented Nov 5, 2025

Thanks! I addressed all of your feedback except for the one I replied to

@zsol zsol force-pushed the zsol/storage-docs branch from 8e54cb2 to 000243f Compare November 5, 2025 14:42
Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@samypr100
Copy link
Collaborator

Should we pull in the changes from #16590 here?

Comment on lines 21 to 28
- `$TMPDIR`
- `/tmp`

=== "Windows"

- `%TMP`
- `%TEMP`
- `%USERPROFILE`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO these should be numbered to make the order of preference clear.

@zsol zsol temporarily deployed to uv-test-registries November 17, 2025 11:23 — with GitHub Actions Inactive
@zsol zsol merged commit 6f525f9 into main Nov 17, 2025
99 of 100 checks passed
@zsol zsol deleted the zsol/storage-docs branch November 17, 2025 14:38
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 18, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.9` -> `0.9.10` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.10`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0910)

[Compare Source](astral-sh/uv@0.9.9...0.9.10)

Released on 2025-11-17.

##### Enhancements

- Add support for `SSL_CERT_DIR` ([#&#8203;16473](astral-sh/uv#16473))
- Enforce UTF‑8-encoded license files during `uv build` ([#&#8203;16699](astral-sh/uv#16699))
- Error when a `project.license-files` glob matches nothing ([#&#8203;16697](astral-sh/uv#16697))
- `pip install --target` (and `sync`) install Python if necessary ([#&#8203;16694](astral-sh/uv#16694))
- Account for `python_downloads_json_url` in pre-release Python version warnings ([#&#8203;16737](astral-sh/uv#16737))
- Support HTTP/HTTPS URLs in `uv python --python-downloads-json-url` ([#&#8203;16542](astral-sh/uv#16542))

##### Preview features

- Add support for `--upgrade` in `uv python install` ([#&#8203;16676](astral-sh/uv#16676))
- Fix handling of `python install --default` for pre-release Python versions ([#&#8203;16706](astral-sh/uv#16706))
- Add `uv workspace list` to list workspace members ([#&#8203;16691](astral-sh/uv#16691))

##### Bug fixes

- Don't check file URLs for ambiguously parsed credentials ([#&#8203;16759](astral-sh/uv#16759))

##### Documentation

- Add a "storage" reference document ([#&#8203;15954](astral-sh/uv#15954))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants