Skip to content

Comments

Fixes workspace member detection to properly handle shared path prefixes#2187

Open
edgarrmondragon wants to merge 3 commits intopypa:masterfrom
edgarrmondragon:fix/workspace-common-path
Open

Fixes workspace member detection to properly handle shared path prefixes#2187
edgarrmondragon wants to merge 3 commits intopypa:masterfrom
edgarrmondragon:fix/workspace-common-path

Conversation

@edgarrmondragon
Copy link
Contributor

Workspace member resolution was mishandling cases where the main project and the member shared a partial directory name (e.g. 'path/to/local_app' and '/path/to/lib_member' share the 'l' string in the last part of the path), it would return an invalid path like '/path/to/l' of the true common ancestor directory. os.path.commonpath correctly returns the nearest common directory, which is what we need as the base for the member glob search.

This is also why os.path.commonprefix will be deprecated in Python 3.15:

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant