-
Notifications
You must be signed in to change notification settings - Fork 293
Allow ability to override slim defaults #216
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
Comments
Huh. Is the issue a file that's remove or a file that's |
I have a similar issue with strip'd files breaking. e.g. opencv
|
What OS are you on and are you using docker? @johnf |
I have found the same problem using sqlalchemy with the
Unfortunately no, because of the way slimPatterns is implemented it concatenates to the list instead of overwriting: let patterns = ['**/*.py[c|o]', '**/__pycache__*', '**/*.dist-info*'];
if (options.slimPatterns) {
patterns = patterns.concat(options.slimPatterns);
} |
Maybe an solution would be to create a new |
Tha would be reasonable @mikepm35 |
I see the point, however I would argue one doesn't need an extra option (i.e. I propose to use a flag for the overwrite option, which let's you disable (or rather enable overwriting) the default patterns. This way backwards compatibility is also kept. I have updated my PR accordingly. Cheers. |
(Note: I am packaging individually with
zip: true
, and am using a branch from @felipe-augusto to deal with the issue as described in #203.)In order to meet lambda size limitations I am using
slim: true
, however I was not able to successfully run due to one my modules (Sagemaker SDK) not being able to find a dependency (in this case urllib3). What I found is that Sagemaker is using pkg_resources to pull the SDK version (below), and then pkg_resources throws an exception because it is not able to identify the distribution information since all of the dist-info files have been removed by slim.SDK_VERSION = pkg_resources.require('sagemaker')[0].version
Setting
slim: false
is not an option for me since I need that additional trimming, but there is no easy workaround since custom slim options only append to the defaults. I could create specialized packages that I trim myself, or create a branch that removes that default option. I went with the latter, but I think it would be a handy feature to allow for overriding the defaults. If defining custom slim options, it might be easier to remove the defaults altogether, and if a user wants them they can add them back in manually or use a specialdefault
option.The text was updated successfully, but these errors were encountered: