Skip to content

Docs suggestion[?]: uv backend needs "--refresh-package" flag to install up-to-date version of local package. #827

@timstaley

Description

@timstaley

Current Behavior

I've just been experimenting with the new uv backend - it's super fast and seems to mostly just work, so much happiness around that :)

However, I hit a fair bit of confusion when running some code via nox and seeing outdated results compared to my IDE.
Swapping backend between venv and uv confirms this is because uv is using a cached (outdated) version of my local package, when it should be rebuilding from the source.
(Possibly related to this issue? astral-sh/uv#2844)

Anyhow, I can fix this if I replace

    session.install(".[dev]")

with

    session.install(".[dev]", "--refresh-package", "my-dev-pkg")

I'm guessing that whether or not this should 'just work' is an upstream issue for the UV folks, but maybe it's worth a note in the Nox docs around UV usage - I imagine this will be a pretty common failure case.

Expected Behavior

With the setting

nox.options.default_venv_backend = "uv"

Installing my package under development into a nox-env via

    session.install(".[dev]")

I expected the same behaviour as plain pip / venv - rebuild and install the latest version of my package from source.

Instead; I get the version of my package from when I first switched backend to uv, because it's caching the build.

Steps To Reproduce

No response

Environment

- OS: MacOS 
- Python: Python 3.11
- Nox: 2024.4.15

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions