Skip to content
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

Support starting from a specified directory, not just current working directory #54

Open
shepmaster opened this issue Jul 15, 2016 · 2 comments

Comments

@shepmaster
Copy link
Member

From the documentation:

which may be absolute or relative to the current working directory.

I'd like to be able to say something like glob_from(path_like_thing, "glob_pattern").

@sffc
Copy link

sffc commented Feb 27, 2021

FYI, this is one of the features of "globwalk" that isn't in "glob": https://github.com/gilnaa/globwalk#why-not-glob

@Gilnaa
Copy link

Gilnaa commented Dec 21, 2023

Is this issue still relevant for glob?
This issue seems to suggest to you don't need a specialized API for this, instead it's possible to just modify the pattern to include the full path.

Is it significant for the starting directory and the pattern to be separate?

konstin added a commit to astral-sh/uv that referenced this issue Sep 26, 2024
The `glob` crate does not allow changing the base directory (rust-lang/glob#54), it always uses the current directory. For workspaces however, our base is the `pyproject.toml`, not the current directory.

If we just join the base directory as we currently do, we risk interpreting the base directory as a glob and not as verbatim. Instead of escaping-and-conversion back-and-forth, we switch to the globwalk crate, which has dedicated support for this.
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

No branches or pull requests

3 participants