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

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.6
File Size Uploaded
uv_refresh-0.1.6.tar.gz 9.5 kB Details

Built distribution (wheel)

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

Total release size: 20.4 kB

Release files / uv_refresh-0.1.6.tar.gz

Download URL uv_refresh-0.1.6.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dad9bd2597705d3ffa9057285cecbc77aa0201c7d585b8d60d4ef61992701368
BLAKE2b-256 checksum
How to use checksums
a543950c7dcb0ac388461efa77f5fd725d4423aed8fc5336eda9d6b3273c172c
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.6-py3-none-any.whl

Download URL uv_refresh-0.1.6-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f2ae3c759b453459cbd1b668c3c25195b14103c5e7b553d3149dd37b9534bba
BLAKE2b-256 checksum
How to use checksums
12f990949cf30ecd74af414cea8c8166f967b2b2351fcf79e15174e419766df5
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

0.1.7

2 release files

This release

0.1.6 This release

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