question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Symbolic link project path not working

See original GitHub issue

Description

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

  1. mklink /J workspace /path/to/source
  2. cd workspace
  3. kedro new
  4. 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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jirikleincommented, Oct 7, 2021

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 with Path.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.

1reaction
jiunbaecommented, Oct 7, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found