Show More
@@ -162,3 +162,20 b' class PackagingMagics(Magics):' | |||||
162 | """ |
|
162 | """ | |
163 | micromamba = _get_conda_like_executable("micromamba") |
|
163 | micromamba = _get_conda_like_executable("micromamba") | |
164 | self._run_command(micromamba, line) |
|
164 | self._run_command(micromamba, line) | |
|
165 | ||||
|
166 | @line_magic | |||
|
167 | def uv(self, line): | |||
|
168 | """Run the uv package manager within the current kernel. | |||
|
169 | ||||
|
170 | Usage: | |||
|
171 | %uv pip install [pkgs] | |||
|
172 | """ | |||
|
173 | python = sys.executable | |||
|
174 | if sys.platform == "win32": | |||
|
175 | python = '"' + python + '"' | |||
|
176 | else: | |||
|
177 | python = shlex.quote(python) | |||
|
178 | ||||
|
179 | self.shell.system(" ".join([python, "-m", "uv", line])) | |||
|
180 | ||||
|
181 | print("Note: you may need to restart the kernel to use updated packages.") |
General Comments 0
You need to be logged in to leave comments.
Login now