-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add glob pattern matching to --paths #3373
base: main
Are you sure you want to change the base?
Conversation
To use wildcards enclose path in '' or "" |
Path(t.cast(t.Union[str, Path], path)).absolute() for path in ensure_list(paths) | ||
Path(t.cast(t.Union[str, Path], p)).absolute() | ||
for path in ensure_list(paths) | ||
for p in (glob.glob(str(path)) or [str(path)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glob.glob()
returns None
for absolute paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share an example for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some digging and it was not the absolute paths.
The issue is that glob.glob
returns an empty list if the pattern doesn't match anything (This was the case for a few pytest cases). The load_configs
function would return an unexpected empty dictionary and cause downstream issues.
Adding or [str(path)]
for the non-existing path will enable the correct downstream invalidation of the path/config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, seems reasonable.
closing #3372
Using
glob.glob
to allow for pattern matching in the--paths
argument.