Fixes workspace member detection to properly handle shared path prefixes#2187
Conversation
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>
|
@cjames23 the CI failures are unrelated and I believe they were introduced by #2188: I can submit a PR adding the two needed |
|
I have a fix coming shortly |
|
|
||
| - Fixes hatch shell type error for keep_env. | ||
| - SBOM documentation for including SBOM files in `sdist` | ||
| - Fixes workspace member detection to properly handle shared path prefixes. |
There was a problem hiding this comment.
Can you rebase and merge? I am about to cut a release for hatch and if you can get this updated inside the release tag for the next release I will include these updates as well.
There was a problem hiding this comment.
I can rebase it, but the branch is up to date, so I'm not sure what you mean.
cjames23
left a comment
There was a problem hiding this comment.
LGTM. I will get this included with the next release a little bit later today. Thank you for finding this and helping!
…xes (#2187) * Add a failing test Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com> * Fixes workspace member detection to properly handle shared path prefixes Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com> * Add changelog entry Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com> --------- Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com> Co-authored-by: Cary Hawkins <hawkinscary23@gmail.com> da427e3
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.commonpathcorrectly returns the nearest common directory, which is what we need as the base for the member glob search.This is also why
os.path.commonprefixwill be deprecated in Python 3.15: