PS C:\whatever> uv run .\scripts\myscript.py
Reading inline script metadata from: .\scripts\myscript.py
error: path could not be converted to a URL: libs\mypackage
In short
Script sources ([tool.uv.sources]) use full paths, do not allow for relative paths e.g. ../libs/mypackage and are thus not platform-agnostic and can't be used by multiple developers.
In depth
Consider this script:
from mypackage import hello
hello("John")
Running uv add --script myscript.py ./libs/mypackage --editable results in this:
But obviously C:\... is not platform agnostic, so to make it work for all developers I need to change it to ..\libs\mypackage, but that doesn't work (see the error above)
The error
In short
Script sources (
[tool.uv.sources]
) use full paths, do not allow for relative paths e.g.../libs/mypackage
and are thus not platform-agnostic and can't be used by multiple developers.In depth
Consider this script:
Running
uv add --script myscript.py ./libs/mypackage --editable
results in this:But obviously
C:\...
is not platform agnostic, so to make it work for all developers I need to change it to..\libs\mypackage
, but that doesn't work (see the error above)