zappa / Zappa

Serverless Python
https://zappa.ws/zappa
MIT License
3.29k stars 364 forks source link

exclude_glob doesn't respect ** operator #1269

Open mcoconnor opened 1 year ago

mcoconnor commented 1 year ago

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: https://github.com/zappa/Zappa/blob/f2f03ba8b58c9e2bdbbff7b5e8c905e3a8c08021/zappa/core.py#L638 and https://github.com/zappa/Zappa/blob/f2f03ba8b58c9e2bdbbff7b5e8c905e3a8c08021/zappa/core.py#L770

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
github-actions[bot] commented 6 months ago

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.

mcoconnor commented 6 months ago

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