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

Avoid re-sync in uv run with dynamic metadata #4946

Closed
charliermarsh opened this issue Jul 9, 2024 · 9 comments · Fixed by #5206
Closed

Avoid re-sync in uv run with dynamic metadata #4946

charliermarsh opened this issue Jul 9, 2024 · 9 comments · Fixed by #5206
Assignees
Labels
needs-decision Undecided if this should be done preview Experimental behavior

Comments

@charliermarsh
Copy link
Member

No description provided.

@charliermarsh charliermarsh added needs-decision Undecided if this should be done preview Experimental behavior labels Jul 9, 2024
@charliermarsh charliermarsh self-assigned this Jul 18, 2024
charliermarsh added a commit that referenced this issue Jul 22, 2024
## Summary

I don't think that "always reinstall" is tenable for `uv run`. My
perspective on this is that if you want "always reinstall", you can now
set it persistently in your `pyproject.toml` or `uv.toml`.

As a smaller change, we could instead disable this _only_ for the
Project API.

Closes #4946.
@blueraft
Copy link
Contributor

I think in uv 0.2.28 it still re-syncs on every uv run invocation.

Seems like 600ms is spent on resolution every time:

❯ uv run black
warning: `uv run` is experimental and may change without warning
Resolved 38 packages in 610ms
Audited 6 packages in 0.01ms

Some verbose logs:

    0.304107s  84ms DEBUG uv_resolver::resolver Split specific environment resolution took 0.082s
       uv_dispatch::install resolution="hatch-fancy-pypi-readme==24.1.0, hatch-vcs==0.4.0, hatchling==1.25.0, packaging==24.1, pathspec==0.12.1, pluggy==1.5.0, setuptools==71.1.0, setuptools-scm==8.1.0, trove-classifiers==2024.7.2", venv="/Users/ahmedilyas/Library/Caches/uv/builds-v0/.tmp16wlC3"
          0.307448s   0ms DEBUG uv_dispatch Installing in hatch-fancy-pypi-readme==24.1.0, hatch-vcs==0.4.0, hatchling==1.25.0, packaging==24.1, pathspec==0.12.1, pluggy==1.5.0, setuptools==71.1.0, setuptools-scm==8.1.0, trove-classifiers==2024.7.2 in /Users/ahmedilyas/Library/Caches/uv/builds-v0/.tmp16wlC3
          0.322034s  14ms DEBUG uv_installer::plan Requirement already cached: hatch-fancy-pypi-readme==24.1.0
          0.329887s  22ms DEBUG uv_installer::plan Requirement already cached: hatch-vcs==0.4.0
          0.334509s  27ms DEBUG uv_installer::plan Requirement already cached: hatchling==1.25.0
          0.339634s  32ms DEBUG uv_installer::plan Requirement already cached: packaging==24.1
          0.344357s  36ms DEBUG uv_installer::plan Requirement already cached: pathspec==0.12.1
          0.345665s  38ms DEBUG uv_installer::plan Requirement already cached: pluggy==1.5.0
          0.354954s  47ms DEBUG uv_installer::plan Requirement already cached: setuptools==71.1.0
          0.355957s  48ms DEBUG uv_installer::plan Requirement already cached: setuptools-scm==8.1.0
          0.361379s  53ms DEBUG uv_installer::plan Requirement already cached: trove-classifiers==2024.7.2
          0.361406s  53ms DEBUG uv_dispatch Installing build requirements: hatch-fancy-pypi-readme==24.1.0, hatch-vcs==0.4.0, hatchling==1.25.0, packaging==24.1, pathspec==0.12.1, pluggy==1.5.0, setuptools==71.1.0, setuptools-scm==8.1.0, trove-classifiers==2024.7.2
         uv_installer::installer::install num_wheels=9
 uv_installer::installer::install num_wheels=9
        0.429133s 235ms DEBUG uv_build Calling `hatchling.build.get_requires_for_build_editable()`
       uv_build::run_python_script script="get_requires_for_build_editable", python_version=3.12.1
        1.152189s 958ms DEBUG uv_build Installing extra requirements for build backend
 uv_resolver::resolver::solve
    1.152336s   0ms DEBUG uv_resolver::resolver Solving with installed Python version: 3.12.1

@charliermarsh
Copy link
Member Author

Can you share any more details about your project? Is there anything else in the verbose logs?

@blueraft
Copy link
Contributor

This was just using black: https://github.com/psf/black

But I think the same is true for flask too.

@charliermarsh
Copy link
Member Author

But what's the project itself that you're running the command from?

@charliermarsh
Copy link
Member Author

Like cloning Black?

@blueraft
Copy link
Contributor

Yes

@charliermarsh
Copy link
Member Author

Ok thank you.

@charliermarsh
Copy link
Member Author

Ok after #5423 it goes down to 23ms for me on Black.

@blueraft
Copy link
Contributor

Awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Undecided if this should be done preview Experimental behavior
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants