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
--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.

Metadata

Release files for uv-refresh 0.1.7

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.7
File Size Uploaded
uv_refresh-0.1.7.tar.gz 9.8 kB Details

Built distribution (wheel)

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

Total release size: 21.0 kB

Release files / uv_refresh-0.1.7.tar.gz

Download URL uv_refresh-0.1.7.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9a59ecf7d964ca685f3eed3ea963c0eed791c5a22284aae76e2d6e2026fc1507
BLAKE2b-256 checksum
How to use checksums
3bef7fd99e610f5caf4de6b1a8053f21b995468cd947e5454c178acaa2d9c34b
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 18, 2026.

Transparency log

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

Download URL uv_refresh-0.1.7-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abfe2cd70ca53aa9cac829bb5e3630b1c13f0833f6e61ad2e7eb6b8a4275d5ad
BLAKE2b-256 checksum
How to use checksums
153c05098d4b62cabbc2590092cbcb5aa93bcdba3fd88fdd07109cbb406d40ed
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 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

This release

0.1.7 This release

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