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

feat(uv): add uv as a pip alternative for dealing with pypi #1640

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KingMichaelPark
Copy link
Contributor

UV is a very fast installer for python packages
that can be 10-100x faster to resolve packages. This adds
an option for Mason to use it instead of pip to resolve
python packages that are installed via Mason.

More info about the replacement: https://github.com/astral-sh/uv
I have no affiliations with uv/astral, it is just very fast and
it would be nice to have updates for packages like sqlfluff take
a lot less time than they currently do to resolve during updates.

@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch 5 times, most recently from 6843a02 to 0514854 Compare February 28, 2024 21:56
@iguanacucumber
Copy link

I think we should do this for bun too, since now it's compatible with alot more things now

@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch 4 times, most recently from 4fbe794 to b1bceba Compare September 13, 2024 14:13
@PyDataBlog
Copy link

Can we get some traction for this? it would boost pkg installation speeds astronomically.

@iguanacucumber
Copy link

i tried installing about 10 python based tools with this PR:

  • with pip -> 2 minutes
  • with uv -> 15 seconds

@iguanacucumber
Copy link

i'm having some issues on another computer:
20241019_15h26m19s_grim

@KingMichaelPark
Copy link
Contributor Author

@iguanacucumber if you could retry it seems to be resolved on my side now

@iguanacucumber
Copy link

20241021_00h40m04s_grim
every other package installs file excepts debugpy

@KingMichaelPark
Copy link
Contributor Author

I won't have time to work on this for a few days so you're more than welcome to open a PR on my branch if you desperately need it. (You should be able to just add debugpy to your dev dependencies in your project as a workaround in the short term)

@KingMichaelPark
Copy link
Contributor Author

KingMichaelPark commented Oct 23, 2024

Alright, debugpy installs now, to have this work with mason-lspconfig I had to fork that for now:

return {
    "neovim/nvim-lspconfig",
    dependencies = {
        { "KingMichaelPark/mason.nvim", opts = { pip = { use_uv = true } } },
        "KingMichaelPark/mason-lspconfig.nvim",
        "hrsh7th/cmp-nvim-lsp",
        "nvim-telescope/telescope.nvim"
    },

UV is a very fast installer for python packages
that can be 10-100x faster to resolve packages. This adds
an option for Mason to use it instead of pip to resolve
python packages that are installed via Mason.

More info about the replacement: https://github.com/astral-sh/uv
I have no relationship with uv, it is just very fast and
it would be nice to have updates for packages like sqlfluff take
a lot less time than they currently do to resolve during updates.

fix: ensure the virtual environment is .venv for uv
@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch 3 times, most recently from 1b2733d to f7fb948 Compare October 25, 2024 21:17
Feat/add uv as pypi source

fix: venv dir can stay venv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants