mirror of https://github.com/astral-sh/uv
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary While working on potential bug fixes with temporary files on Windows (I think I am currently ecountering the same issue as #2810) I noticed that sub-workspaces were not all having the same `tempfile` version. And they were not relying on the cargo root project dependency. I don't know at all if it was done on purpose or not. (I also wanted to override the root dependency with a local source but it was not possible due to sub-workspaces not relying on the same). The root lockfile already pinned to the `3.14.0`. Some sub-workspaces were depending on the `3.12.0`, some others on the `3.14.0`. So I updated the root `Cargo.toml` to the `3.14.0`. Feel free to decline if it was done on purpose! No worries at all 🙂 Thanks! <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan All units tests are still passing on my side. Let's see with the pull-request CI 😄 |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
README.md
globfilter
Portable directory walking with includes and excludes.
Motivating example: You want to allow the user to select paths within a project.
include = ["src", "License.txt", "resources/icons/*.svg"]
exclude = ["target", "/dist", ".cache", "*.tmp"]
When traversing the directory, you can use
GlobDirFilter::from_globs(...)?.match_directory(&relative) skip directories that never match in
WalkDirs filter_entry.
Syntax
This crate supports the cross-language, restricted glob syntax from PEP 639:
- Alphanumeric characters, underscores (
_), hyphens (-) and dots (.) are matched verbatim. - The special glob characters are:
*: Matches any number of characters except path separators?: Matches a single character except the path separator**: Matches any number of characters including path separators[], containing only the verbatim matched characters: Matches a single of the characters contained. Within[...], the hyphen indicates a locale-agnostic range (e.g.a-z, order based on Unicode code points). Hyphens at the start or end are matched literally.
- The path separator is the forward slash character (
/). Patterns are relative to the given directory, a leading slash character for absolute paths is not supported. - Parent directory indicators (
..) are not allowed.
These rules mean that matching the backslash (\) is forbidden, which avoid collisions with the
windows path separator.