Remove library without removing source
11:13 02 Mar 2026

I have made a custom library, let's call it mylib.

In another project which uses this custom library of mine, I have put the following in its pyproject.toml:

[tool.uv.sources]
mylib= { path = "C:/data/progetti_miei/mylib-python", editable=true }

and then in the project directory I add:

uv add mylib

The problem is that when I add a new dependency to my custom library (by modifying its pyproject.toml), I have to remove and re-add the custom library to my project (merely restarting the Jupyter kernel is not sufficient).

To do so, I run:

uv rm mylib

But this command removes the mylib= line in the [tool.uv.sources] of my project's pyproject.toml.

How can I remove a library from a project pyproject.toml without removing the corresponding source line?

python uv