You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a plone/volto project created by cookieplone and I have added a mx.ini to "backend/" folder. Then I run latest mxdev uvx --from git+https://github.com/mxstack/mxdev@main#egg=mxdev[uv] mxdev to let it update "[tool.uv.sources]" in pyproject.toml. This works great!
But if I remove a source from mx.ini it is not removed from pyproject.toml
Confirmed. The [tool.uv.sources] table is only ever updated additively by the uv hook.
In UvPyprojectUpdater._update_pyproject() (src/mxdev/uv.py), the sources section iterates exclusively over the packages currently declared in mx.ini:
forpkg_name, pkg_datainpackages.items(): # only packages CURRENTLY in mx.ini
...
uv_sources[pkg_name] =source_table# add / overwrite — never delete
So entries are created and overwritten, but there is no reconciliation step that removes a source whose package was dropped from mx.ini. Since the removed package no longer appears in packages, the hook never visits it and its stale entry lingers in pyproject.toml. That matches the reported behavior exactly.
Note this is specific to [tool.uv.sources]. override-dependencies (and constraint-dependencies) don't have the problem because the hook rewrites those arrays in full on every run, effectively owning them. [tool.uv.sources], on the other hand, is a shared table that may also contain user-defined sources (git/url/workspace/path entries not created by mxdev), so it can't simply be cleared — the hook needs a way to distinguish the entries it manages from foreign ones before it can safely remove stale ones.
Activity
jensens commentedon May 31, 2026
Root cause analysis
Confirmed. The
[tool.uv.sources]table is only ever updated additively by the uv hook.In
UvPyprojectUpdater._update_pyproject()(src/mxdev/uv.py), the sources section iterates exclusively over the packages currently declared inmx.ini:So entries are created and overwritten, but there is no reconciliation step that removes a source whose package was dropped from
mx.ini. Since the removed package no longer appears inpackages, the hook never visits it and its stale entry lingers inpyproject.toml. That matches the reported behavior exactly.Note this is specific to
[tool.uv.sources].override-dependencies(andconstraint-dependencies) don't have the problem because the hook rewrites those arrays in full on every run, effectively owning them.[tool.uv.sources], on the other hand, is a shared table that may also contain user-defined sources (git/url/workspace/path entries not created by mxdev), so it can't simply be cleared — the hook needs a way to distinguish the entries it manages from foreign ones before it can safely remove stale ones.Fix #83: prune stale [tool.uv.sources] entries
Fix mxstack#83: remove stale entries from [tool.uv.sources] (mxstack#91)