astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

Workspace members: Added symbolic link support #1074

Open LLouice opened 4 months ago

zanieb commented 4 months ago

Hi! Can you say a bit more about why this change is important or link to some prior discussion?

LLouice commented 4 months ago

Sorry for the late reply.

I am not sure if the fact that workspace members do not follow symbolic links is intentional. If it is, perhaps we could add a clear flag like follow-link = true to accommodate this PR. The reason I want to add this feature is to solve an issue I am facing, which is as follows:

- MyMonoRepo
  - libs
    - util_lib
  - Projects
    - projectA
      - src
        - projectA
      - pyproject.toml
      - libs
        - util_lib_lnk -> MyMonoRepo/libs/util_lib  # symbolic link as workspace member

      - projectB

When developing any project, such as projectA, I want to include util_lib as a workspace member and install it editable locally. However, util_lib is not located within the projectA directory, and I found that this can be achieved through symbolic links.

Is there another method that I am not aware of that can accomplish what I want?

It seems that PR #1023 is related to this PR, as both are about locating workspace members in a mono repo. Symbolic links seem to be a possible solution.