Skip to content

Commit 47f4b58

Browse files
committed
parse_specifier_for_install: using abs path for constraint and requirements
1 parent bd69963 commit 47f4b58

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

changelog.d/1389.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix error with `pipx install` Command Using Relative Path for Pip Arguments

src/pipx/package_specifier.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,22 @@ def parse_specifier_for_install(package_spec: str, pip_args: List[str]) -> Tuple
161161
)
162162
pip_args.remove("--editable")
163163

164-
return (package_or_url, pip_args)
164+
pip_args = [option for pip_arg in pip_args for option in pip_arg.split(" ")]
165+
166+
for option in pip_args:
167+
if "-c" in option or "--constraint" in option:
168+
option_list = option.split("=")
169+
170+
if len(option_list) != 2:
171+
continue
172+
173+
key, value = option_list
174+
value_path = Path(value).expanduser().resolve()
175+
pip_args[pip_args.index(option)] = f"{key}={value_path}"
176+
177+
break
178+
179+
return package_or_url, pip_args
165180

166181

167182
def parse_specifier_for_metadata(package_spec: str) -> str:

0 commit comments

Comments
 (0)