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

The uv cache is preventing me from updating the environment with my lastest development #914

Open
12rambau opened this issue Jan 27, 2025 · 1 comment
Labels

Comments

@12rambau
Copy link

12rambau commented Jan 27, 2025

Current Behavior

I tried to use the new cool kid of package management in my nox sessions , namely uv.

I run things as simple as this:

@nox.session(reuse_venv=True, venv_backend="uv")
def test(session):
    """Run the selected tests and report coverage in html."""
    session.install(".[test]")
    test_files = session.posargs or ["tests"]
    session.run("pytest", "--cov", "--cov-report=html", *test_files)

from my package and recently I was trying to handle a more complicated prblem of error catching. WHataver the changes I was making the result of my test was never changing. After some time I decided to remove the "uv" backend and everything started to work as expected. My finding is that session.install(".[test]") is not honored by the uv backend and the lib I'm working on is never reinstalled which makes it unusable.

Expected Behavior

I would like the session.install(".") to be honored as per pip i.e. reinstalling the local package systematically.

@12rambau 12rambau added the bug label Jan 27, 2025
@12rambau 12rambau changed the title <title> The uv cache is preventing me from updating the environment with my lastest development The uv cache is preventing me from updating the environment with my lastest development Jan 27, 2025
@henryiii
Copy link
Collaborator

henryiii commented Jan 28, 2025

That's a bug/feature with uv. Here's the warning copied from our docs:

Warning

The uv backend does not reinstall, even for local packages, so you need to include --reinstall-package <pkg-name> (uv-only) if reusing the environment.

Longer term, maybe we could introduce some sort of command like .install_package(extras=["test"], editable=False) that adds this for uv.

Though I'm not sure how we can guess the package name reliably...

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

No branches or pull requests

2 participants