-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add uv line magic #14537
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
Add uv line magic #14537
Conversation
355cacc to
47ef0c1
Compare
20a3581 to
b0d61ed
Compare
|
I'm not sure this is worth it, what you are doing is basically transforming the I would suggest to make it as a package and if there is more interest and advantages over |
|
I think the motivation here is that
(I'm sure you know this much better than I do, I just want to include some motivation that is missing from the PR description.) I can see the counter-argument here: should the ipython project be responsible for including magics for every python package/environment management module? That's definitely a question for the ipython maintainers. I don't know what the adoption rates for |
Yes, but for pip I do take special care of actually calling Unless I misunderstand how shutil.which works, or missed something else in the PR. (Which is honestly quite likely I'm just getting out of a few days sick and still brainfoggy). |
|
Thank you for the feedback! I will work on updating the PR to use |
b0d61ed to
bf9303a
Compare
|
I'm still not 100% convinced it is needed, but let's try it. |
|
Thanks. |
|
Err, this requires uv to have been installed to the Python env, which is not the usual uv installation method. Usually it is installed directly or with cargo, their executable autodetects a .venv presence, and there is no Python package in-env. With a normal uv installation, if you try to use this magic, you'll currently get something like: A more correct approach would be to make the magic use |
This adds the ability to install packages using
%uv install [pkgs]line magic.