Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rez-pip should cleanly fail if resolving a python package fails #54

Open
JeanChristopheMorinPerso opened this issue Oct 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@JeanChristopheMorinPerso
Copy link
Owner

See https://academysoftwarefdn.slack.com/archives/C0321B828FM/p1697125828936919?thread_ts=1697123068.952239&cid=C0321B828FM.

Seems my issue is that I had an issue that caused Rez to be able to find a "pip" package, but when performing the resolve, it broke. There doesn't appear to be any sort of check in the code to confirm that the ResolvedContext.status == ResolverStatus.solved

This applies to the original rez-pip, but it also applies to us.

I don't know in which case a solve would fail for such simple requests, but we should support failures just in case. See

rez-pip/src/rez_pip/rez.py

Lines 246 to 262 in 9c61a5d

for package in packages:
resolvedContext = rez.resolved_context.ResolvedContext(
[f"{package.name}=={package.version}"]
)
# Make sure that system PATH doens't interfere with the "which" method.
resolvedContext.append_sys_path = False
for trimmedVersion in map(package.version.trim, [2, 1, 0]):
path = resolvedContext.which(f"python{trimmedVersion}", parent_environ={})
if path:
pythons[str(package.version)] = pathlib.Path(path)
break
else:
_LOG.warning(
f"Failed to find a Python executable in the {package.qualified_name!r} rez package"
)
.

@JeanChristopheMorinPerso JeanChristopheMorinPerso added the enhancement New feature or request label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant