Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
timstaley opened this issue May 9, 2024 · 1 comment · Fixed by #830
Labels

Comments

@timstaley
Copy link

timstaley commented May 9, 2024

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

@timstaley timstaley added the bug label May 9, 2024
@timstaley timstaley changed the title Docs suggestion[?]: "uv" backend needs "--refresh-package" flag to install up-to-date version of local package. Docs suggestion[?]: uv backend needs "--refresh-package" flag to install up-to-date version of local package. May 9, 2024
@henryiii
Copy link
Collaborator

-e. is better, though it looks like even that isn't rebuild, so it wouldn't work well for a binary package (or when adding entry points, etc).

Would be a good thing to document until/if something changes upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants