metagenopolis/meteor

Meteor should create symlinks with relative, not absolute paths

Closed this issue · 2 comments

Absolute paths prevent moving a project directory.
The "relative_to" method from the Path class should do the trick.

from pathlib import Path
Path('/projects/meteor/merging/').relative_to('/projects/meteor/profile/', walk_up=True)

The proposed solution is not working python 3.10 but only >=3.12.

Another solution is to use the old os module

>>> os.path.relpath('/projects/meteor/profile','/projects/meteor/merging')
'../profile'