Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Reduce size of installed dependencies by slimming #191
What I did
custom: pythonRequirements: slim: true
Then a script removes the unnecessary files : removes
That happens by appending extra commands during the execution of the
Would appreciate any feedback and and be grateful for suggestions for alternative solutions to the problem I attempt to solve with this change. If the proposal is actually is somehow useful, would be glad to know
One more change and we should be good to go, could you add a
slim: false default value in this default options object: https://github.com/UnitedIncome/serverless-python-requirements/blob/master/index.js#L28-L52
ok couple of hours later, how would you like to have a simple patch submitted to support the slim down support for non docker builds?
patch is more or less:
For the non-docker builds I didn't plan to include the support for this originally
Mainly because the commands for reducing the package size are known to work in the POSIX environments so by asking docker to run them we can be sure for it to work.
I could work to include it here, but that would increase the pull request scope -- should I or maybe submitting a separate one would be better?
It would and is also highly required since otherwise, it's near impossible to deploy any large pandas libs. Can we maybe add a check to support slim mode on Linux or Docker system's only?
also, another request would be, can we specify which patterns to exclude? For example, removing all
awesome, thanks for now I forked you repo to get my project going for the time going g.…
On Thu, May 17, 2018 at 2:08 PM, Dmitry Orlov ***@***.***> wrote: True, that's a very good point, thanks - I will work on this in the upcoming days then! - Specifying patterns to remove - Non Docker build support — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#191 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAA_7DSu_51znFWB-d4UMN4rG-qgGNYgks5tzea8gaJpZM4T-ntr> .
-- ------------------------------------------------------------ Lead Developer - Fiehnlab, UC Davis gert wohlgemuth work: http://fiehnlab.ucdavis.edu/staff/wohlgemuth phone: 530 665 9477 coding blog: http://codingandmore.blogspot.com linkedin: http://www.linkedin.com/profile/view?id=28611299&trk=tab_pro
Hi, tried using this but doesn't seem to be working for me, still getting tests included. (windows machine)
e.g. for pystache still seeing all the test files.
Am i missing something?
This is my serverles.yml
@sweepy84 oh, indeed, the thing is - the
+ also, it works (
maybe was a bad idea to be limit to directories, but was reasoning for preventing the deletion of possible required files - with this #191 (comment) - maybe not necessarily so
let me know if this helps, otherwise also possible make a patch on it ;)
@dee-me-tree-or-love thanks for the reply!
Even using dockerizePip it still has test folders (I thought "slim" would remove them without slimPattern),
Still getting test folders >> https://snag.gy/g5SelK.jpg
@sweepy84 hey - I have looked into it and replicated the problem - oupsie, it's the
I have tried disabling the windows check and running the commands from git bash, but that results in error:
what I am referring to is this line here:
The easiest and safest workaround for now could be using
and the resulting pystache in the zip:
Oh. yeah i see no reason to keep it disabled when using docker on win32. Also.. it's a bit bigger of a change... but I'd love it if the