Created
August 16, 2018 14:05
-
-
Save mehdisadeghi/7b17a8eb5d5db2ae8de722d469d4a174 to your computer and use it in GitHub Desktop.
serverless-package-python-functions patch for pip upgrade and aws invoke local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121a122,124 | |
> this.log('Upgrading pip inside the container.') | |
> this.runProcess('docker', ['exec', this.containerName, 'pip', 'install', '--upgrade', 'pip']) | |
> this.log('Pip upgrade finished.') | |
166a170,187 | |
> loadEnvVars() { | |
> let pythonPath = '' | |
> if (this.globalIncludes) { | |
> this.log(`Adding global includes to the python path: ${this.globalIncludes}`) | |
> pythonPath += `:${this.globalIncludes}` | |
> } | |
> | |
> if (this.options.f) { | |
> pythonPath += `:${this.options.f}` | |
> | |
> if (this.serverless.service.functions[this.options.f].package.include) { | |
> this.serverless.service.functions[this.options.f].package.include.forEach( | |
> (item) => {pythonPath += `:${item}`}) | |
> } | |
> } | |
> process.env['PYTHONPATH'] = pythonPath | |
> } | |
> | |
181c202,205 | |
< .then(this.clean) | |
--- | |
> .then(this.clean), | |
> | |
> 'invoke:local:loadEnvVars': () => BbPromise.bind(this) | |
> .then(this.fetchConfig).then(this.loadEnvVars), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just patch your installation and you are good to go:
Related Github issue: ubaniabalogun/serverless-package-python-functions#26
Edit: I have used the following commit to create the above patch:
ubaniabalogun/serverless-package-python-functions@917d4ce