Skip to content

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 KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch from 6170264 to 6c3a15e Compare October 20, 2024 17:27
@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"
    },

@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch 4 times, most recently from f7fb948 to f724f1a Compare October 26, 2024 07:08
@lljbash
Copy link

lljbash commented Jan 15, 2025

This PR is really helpful! I was wondering if the maintainer has any plans to merge it? @williamboman

@dusktreader
Copy link

Not only would this boost install speeds dramatically for lsps that are installed via pip, it would also eliminate the need for pip itself and consequently for python3-venv.

Further, the packages could require different versions of python since uv can install python binaries as well. I believe this happens automatically.

@user520881
Copy link

is there plans to merge this?

@Xylot
Copy link

Xylot commented May 6, 2025

@williamboman Are there plans to merge this?

For anyone that needs a quick workaround, I noticed that Mason appends itself to the top of the path at nvim startup:

:echo $PATH
>>> ~/.local/share/nvim/mason/bin:...

So I just symlinked my system python to that directory in order to force Mason to recognize it first.

ln -s /usr/bin/python3 ~/.local/share/nvim/mason/bin/python3

@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch 2 times, most recently from 0bdf8da to 91ed1a0 Compare May 7, 2025 16:29
@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch 5 times, most recently from 71f1a68 to 8f4c63b Compare May 8, 2025 06:05
@LogPRose
Copy link

Any updates on merging?

@effigies
Copy link

effigies commented Jun 2, 2025

It looks like this PR is falling afoul of contributing guidelines:

Adding or changing a feature

Adding or changing a feature MUST be preceded with an issue where scope and acceptance criteria are agreed upon with project maintainers before implementation.

Probably makes sense to open an issue and discuss, rather than keep pinging here.

@KingMichaelPark
Copy link
Contributor Author

#1972

@Conarius
Copy link

Conarius commented Jul 8, 2025

Quick question:
Does this also appear in checkhealth? Cuz imo it should but marked as optional

@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch from 204cb25 to 1df10d0 Compare July 21, 2025 08:05
@KingMichaelPark
Copy link
Contributor Author

Quick question: Does this also appear in checkhealth? Cuz imo it should but marked as optional

Now it does.

@Conarius Conarius requested a review from a team July 22, 2025 11:07
@Conarius Conarius requested a review from a team July 22, 2025 11:07
@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch from 1df10d0 to 37b5b83 Compare September 18, 2025 08:15
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

fix: venv dir can stay venv

feat: update stdio ctx reference

feat: add uv as installer for python

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

fix: venv dir can stay venv

feat: update stdio ctx reference

feat: add checkhealth entry and fix formatting

feat: fix formatting

fix: cbfmt 404
@KingMichaelPark KingMichaelPark force-pushed the feat/add-uv-as-pypi-source branch from 09b940d to 32c755a Compare September 18, 2025 08:50
@KingMichaelPark
Copy link
Contributor Author

@williamboman @seblyng @mirekdlugosz This also fixes the 404 in your CI for shellharden.

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.

10 participants