Skip to main content

uv-refresh

Rebuilds a uv project's pyproject.toml so every dependency gets freshly resolved instead of dragging along old version pins.

How it works

  1. Read pyproject.toml, collect the dependencies without their version specifiers (extras and environment markers are kept; include-group entries in dependency-groups are resolved, not dropped)
  2. Back up pyproject.toml and uv.lock into .uv-refresh-backup/<timestamp>/
  3. Run uv init --bare + uv add <packages> in a temp directory next to the project -- the real pyproject.toml stays untouched the whole time
  4. Merge only dependencies/optional-dependencies/dependency-groups from the result into a copy of the ORIGINAL pyproject.toml -- everything else stays untouched
  5. Atomically swap the result in place of the old pyproject.toml/uv.lock

If any step fails -- including Ctrl+C -- the real pyproject.toml was never touched, since the whole build happened in the temp directory. The backup is kept around as an extra reference regardless.

Installation

uv tool install uv-refresh

Makes uv-refresh permanently available as a command (globally on PATH).

For a one-off test run, without installing anything:

uvx uv-refresh --dry-run

Or straight from the repo, e.g. to try an unreleased version:

uv tool install git+https://github.com/Zorakidd/uv-refresh

Usage

uv-refresh --dry-run     # just show what would happen, change nothing
uv-refresh               # runs with a confirmation prompt
uv-refresh -y            # no confirmation prompt

Options

Flag Effect
--path PATH different project directory (default: current)
--dry-run only show what would happen, touch nothing
-y, --yes run without asking for confirmation
-v, --verbose print the full new pyproject.toml at the end
-q, --quiet only print warnings/errors, no status output
--timeout SECONDS timeout per uv call, default 300s
--raw add packages with no version bound at all
--bounds {lower,major,minor,exact} kind of version bound uv add sets
--keep-lock keep uv.lock (uv will then prefer the old versions!)
--keep-backups N how many past backups to keep, oldest deleted first (default: 5, 0 keeps all)
--no-groups ignore optional-dependencies and dependency-groups
--full re-pin .python-version to the newest installed Python
--drop-extras shrink fastapi[standard] down to fastapi
--drop-markers drop environment markers
--version show the uv-refresh version

Note

Only dependencies, optional-dependencies and dependency-groups are rewritten. Everything else -- description, readme, license, authors, keywords, [project.urls], [project.scripts], [build-system], [tool.*] and so on -- stays unchanged, because it's never deleted: the tool only builds a minimal pyproject.toml temporarily to resolve versions, then takes just the freshly resolved dependency lists from it and writes those back into a copy of the original file.

One exception: with --no-groups, any existing optional-dependencies/dependency-groups are intentionally removed (the tool warns beforehand). Individual entries that can't be interpreted as a PEP 508 string are skipped and reported per entry.

--full runs before any of that: it re-pins .python-version via uv python pin to the newest already installed Python it can find (uv python list --only-installed) -- it never triggers a download on its own. uv python pin refuses to write anything if the target version doesn't satisfy requires-python, so a failure here leaves an existing .python-version untouched.

Metadata

Release files for uv-refresh 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uv-refresh 0.1.11
File Size Uploaded
uv_refresh-0.1.11.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uv-refresh 0.1.11
File Interpreter ABI Platform
uv_refresh-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / uv_refresh-0.1.11.tar.gz

Download URL uv_refresh-0.1.11.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
69009c78ff3f5a80e8432e209cf3774d48cd3c0fb2ad0e69ec2573d0a247b0fc
BLAKE2b-256 checksum
How to use checksums
fa7608d69f5a19d345d206f94709847be33bb858c364c326418e035ee714c1bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release files / uv_refresh-0.1.11-py3-none-any.whl

Download URL uv_refresh-0.1.11-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67e892f0425d96bed7700474552639e601a42401d56c841575dca8a43af62179
BLAKE2b-256 checksum
How to use checksums
1852c053bc45f69e9f03ecb8e309e5f41d9715747648fc100fe82ed6893d175f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.13

2 release files

0.1.12

2 release files

This release

0.1.11 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page