-
Notifications
You must be signed in to change notification settings - Fork 5
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
Local dependency path resolution can fail on *nix #266
Comments
Hi @tymokvo, thank you for documenting this. How important is resolving this issue for finishing the other PR for updating the docs? |
Medium important, I guess. I can't really use the example that you put together until the |
So I've been digging into this a bit today and I think the issue stems from the use of |
If that works then I have nothing against it. urlparse was not great in handling local files and that why the related -> c69a7fe |
Ugh, windows. Ok, well I will try a different solution, then. |
This PR addresses the issue with resolving the local path as a uri. It took mixed usage of `os.path` and `pathlib.Path` to get it right on both Windows and Linux. Part of the issue was how in Windows and \*nix systems based on what the uri is pointing to the number of slashes after file:// can be 2 or 3! I was expecting it to always be 3 which would return `home/user/...` instead of `/home/user/...`. The first one is considered an absolute path and the second one is relative! That's the main reason that it was failing. I also took the opportunity to clean the code a little bit. resolves pollination#266
This PR addresses the issue with resolving the local path as a uri. It took mixed usage of `os.path` and `pathlib.Path` to get it right on both Windows and Linux. Part of the issue was how in Windows and \*nix systems based on what the uri is pointing to the number of slashes after file:// can be 2 or 3! I was expecting it to always be 3 which would return `home/user/...` instead of `/home/user/...`. The first one is considered an absolute path and the second one is relative! That's the main reason that it was failing. I also took the opportunity to clean the code a little bit. resolves #266
🎉 This issue has been resolved in version 1.23.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Steps to reproduce
pollination-dsl
dependencypollination dsl translate <name of recipe using local dependency> <some local path>
Expect:
Command fails with:
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '//<current working directory>/<absolute path to index.json>'>
This appears to come from this line where the assumption is made that, if the path starts with
file://
, then it is relative to the current working directory.The text was updated successfully, but these errors were encountered: