-
Notifications
You must be signed in to change notification settings - Fork 24k
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
Improve fileglob lookup - Pattern matching on directory & file #83600
base: devel
Are you sure you want to change the base?
Conversation
The test
The test
The test
The test
|
* Replace os.path by Pathlib library & refactor * Add new feature : Pattern matching on directory & file * Add new integration test for cover new feature
d6a70ab
to
be6e985
Compare
For Windows path, there is a difference between `str(p)` & `p.as_posix()`
Seems correct, I did a review during pycon.fr with submitter and @pilou- The behavior did seems curious, but that was the original one, so I would say LGTM. |
- Matches all files in a single directory, non-recursively, that match a pattern. | ||
It calls Python's "glob" library. | ||
- Matches all files in directory that match a pattern. | ||
It calls Python's "`Path.glob <https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob>`_" library. |
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.
It calls Python's "`Path.glob <https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob>`_" library. | |
It calls Python's "L(Path.glob, https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob)" library. |
SUMMARY
Hi, I modify and improve
fileglob
lookup for adding pattern matching to folder and keeping the previous behaviors.I made this change because I think it's a shame that this lookup doesn't have these features and that it's laborious to get the same behavior by other means.
I replace
os.path
library byPathlib
because it's a better library for manipulate filesystem paths. This library was added in Python 3.4. I add new integration test and examples for cover this new features. I run sanity and integration test forfileglob
, there are no errors.I welcome any feedback to improve this PR. Thanks.
ISSUE TYPE