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

exclude_glob doesn't respect ** operator #1269

Open
mcoconnor opened this issue Aug 23, 2023 · 2 comments
Open

exclude_glob doesn't respect ** operator #1269

mcoconnor opened this issue Aug 23, 2023 · 2 comments
Labels
needs-review Needs attention from a maintainer

Comments

@mcoconnor
Copy link

Context

One of the more useful tools in glob is being able to use the ** operator to match patterns at any point in the tree; however, that requires the recursive flag to be turned on in the glob.glob function: https://docs.python.org/3.9/library/glob.html#glob.glob

It appears that that has not been used:

for path in glob.glob(os.path.join(temp_project_path, glob_path)):

and
for path in glob.glob(os.path.join(temp_project_path, glob_path)):

However, the ** operator is used in the example in the docs:
https://github.com/zappa/Zappa/blame/f2f03ba8b58c9e2bdbbff7b5e8c905e3a8c08021/README.md#L951

Expected Behavior

An exclude_glob entry with a **, e.g. "**/__pycache__" should recurse through the directory tree to identify and eliminate matching paths

Actual Behavior

** operators are ignored by glob

Possible Fix

Add the recursive=True argument to each of the places where exclude_glob paths are used

Steps to Reproduce

  1. Identify a directory common to multiple paths in the project
  2. Add a matching glob path to exclude_glob
  3. Run zappa package
  4. Observe that the paths have not been removed from the packaged project
Copy link

github-actions bot commented Apr 3, 2024

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

@github-actions github-actions bot added the no-activity [Bot] Closing soon if no new activity label Apr 3, 2024
@mcoconnor
Copy link
Author

This is still relevant, I am trying to find time to update the PR

@github-actions github-actions bot added needs-review Needs attention from a maintainer and removed no-activity [Bot] Closing soon if no new activity labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review Needs attention from a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant