Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Can't use exclusion glob patterns in slimPatterns #372

@mjpieters

Description

@mjpieters

Currently the strip option runs each pattern through glob-all.glob.sync() separately:

https://github.com/UnitedIncome/serverless-python-requirements/blob/f39e166e8221171ec040ca37fe0f98b6ed89ad75/lib/slim.js#L48-L52

This means we can't make use of the glob-all feature giving you exclude patterns.

Can this be updated to map all patterns to their ${folderPath}/${pattern} form and then pass the whole list as one to glob-all.glob.sync()?

I realise that this requires hoisting up the ! at the start of negation patterns pattern, e.g.

slimPatterns:
- "**/*.dist-info*"
- "!**/specific_package.dist-info*"

needs to be translated (given folderPath = "/foo/bar/") to

patterns = [
    "/foo/bar/**/*.dist-info*",
    "!/foo/bar/**/specific_package.dist-info*"
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions