Symbolic link project path not working
See original GitHub issueDescription
If the project path exists on the symlink, an error occurs when Kedro CLI is created.
Context
Workspace is a symbolic link, but when I run the kedro project on it, I get a problem that it cannot be executed.
on windows
Steps to Reproduce
mklink /J workspace /path/to/source
cd workspace
kedro new
kedro info
Expected Result
Actual Result
Traceback (most recent call last):
File "C:\Users\-\conda\Scripts\kedro-script.py", line 9, in <module>
sys.exit(main())
File "C:\Users\-\conda\lib\site-packages\kedro\framework\cli\cli.py", line 265, in main
cli_collection = KedroCLI(project_path=Path.cwd())
File "C:\Users\-\conda\lib\site-packages\kedro\framework\cli\cli.py", line 183, in __init__
self._metadata = bootstrap_project(project_path)
File "C:\Users\-\conda\lib\site-packages\kedro\framework\startup.py", line 184, in bootstrap_project
_add_src_to_path(metadata.source_dir, project_path)
File "C:\Users\-\conda\lib\site-packages\kedro\framework\startup.py", line 168, in _add_src_to_path
_validate_source_path(source_dir, project_path)
File "C:\Users\-\conda\lib\site-packages\kedro\framework\startup.py", line 159, in _validate_source_path
raise ValueError(
ValueError: Source path 'workspace\test\src' has to be relative to your project root 'workspace-link\test'.
Your Environment
- Windows 11 (21H2, 22000.194)
- Python==3.8.10
- Kedro>=0.17.0 (tested 0.17.0, 0.17.5)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Symlinks not working when link is made in another directory?
Symbolic links are relative to the location the link is in, not the location where it was created or opened.
Read more >Symbolic link project path not working · Issue #941 · kedro-org ...
Workspace is a symbolic link, but when I run the kedro project on it, I get a problem that it cannot be executed....
Read more >VS project does not load when a symbolic link is in the ...
I have a NodeJS project. It has /public folder from where static files are served. To serve files from a shared network drive...
Read more >Why doesn't my symbolic link work? - Super User
Symlinks tend to like full paths or relative to the link, otherwise they can often be looking for file-1.txt locally (oddly enough).
Read more >Using Symbolic Links with Directory Monitoring - Unity Forum
I understand the problems that may arise from recursive symlinks or use symlinks to share assets between projects. My use case accounts for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @jiunbae - thank you, this looks like a super elegant solution. I had a look at the
Path.resolve
implementation here (https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve) and I think for these purposes we’ll go withPath.resolve(strict=True)
.However, we would need to see tests for Win, Darwin and Linux as the way all of these platforms resolve paths (and symlinks, for that matter) differs and can throw some unexpected behaviour.
Tried to create a PR, but I left an issue first because it takes times to prepare the things necessary for environment setting such as test, CI and getting used to the kedro contribution convention.