-
-
Notifications
You must be signed in to change notification settings - Fork 635
Closed as duplicate of#2215
Copy link
Description
I'm getting ValueError: relative path can't be expressed as a file URI for one optional dependency referencing another after updating pip-tools from 7.4.0 to 7.5.0.
Environment Versions
- OS Type: Ubuntu 22.04
- Python version: 3.13.2
- pip version: 25.2
- pip-tools version: 7.5.0
Steps to replicate
My pyproject.toml looks somewhat like this:
[project]
name = "da"
# ...
dependencies = [
# ...
]
[project.optional-dependencies]
utils = [
# ...
]
test = [
"da[utils]",
# ...
]Expected result
Compiled requirements.
I haven't altered my pyproject in any way after or before updating pip-tools.
Compile works after I comment out da[utils].
Actual result
$ pip-compile -o requirements.txt pyproject.toml
Using pip-tools configuration defaults found in 'pyproject.toml'.
Traceback (most recent call last):
File "/some/path/da/venv/bin/pip-compile", line 7, in <module>
sys.exit(cli())
~~~^^
File "/some/path/da/venv/lib/python3.13/site-packages/click/core.py", line 1442, in __call__
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/some/path/da/venv/lib/python3.13/site-packages/click/core.py", line 1363, in main
rv = self.invoke(ctx)
File "/some/path/da/venv/lib/python3.13/site-packages/click/core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/some/path/da/venv/lib/python3.13/site-packages/click/core.py", line 794, in invoke
return callback(*args, **kwargs)
File "/some/path/da/venv/lib/python3.13/site-packages/click/decorators.py", line 34, in new_func
return f(get_current_context(), *args, **kwargs)
File "/some/path/da/venv/lib/python3.13/site-packages/piptools/scripts/compile.py", line 371, in cli
metadata = build_project_metadata(
src_file=Path(src_file),
...<4 lines>...
quiet=log.verbosity <= 0,
)
File "/some/path/da/venv/lib/python3.13/site-packages/piptools/build.py", line 159, in build_project_metadata
project_metadata = maybe_statically_parse_project_metadata(src_file)
File "/some/path/da/venv/lib/python3.13/site-packages/piptools/build.py", line 106, in maybe_statically_parse_project_metadata
requirement.url = src_file.parent.as_uri()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/path/.pyenv/versions/3.13.2/lib/python3.13/pathlib/_local.py", line 431, in as_uri
raise ValueError("relative path can't be expressed as a file URI")
ValueError: relative path can't be expressed as a file URIMetadata
Metadata
Assignees
Labels
No labels