Closed
Description
For the first time, I am trying to use the Serverless Framework using the google-python
template and serverless-python-requirements
. I am a big fan of poetry
and would like to use it for this project.
My serverless.yml
is below. Based on the errors I am getting, I can tell that it is not using poetry
when running sls deploy
.
Error: python38 not found! Try the pythonBin option.
at pipAcceptsSystem (/Users/username/dev/cloudfunctions/node_modules/serverless-python-requirements/lib/pip.js:104:13)
Ideally, I shouldn't have to set pythonBin
if poetry
is detected right? Does anyone have a suggestion, how I should set up my projects, so that python
and pip
are picked up from the virtualenv that poetry
is managing?
serverless.yml
service: cloudfunctions
provider:
name: google
stage: dev
runtime: python38
project: notShown
frameworkVersion: '2'
plugins:
- serverless-google-cloudfunctions
- serverless-python-requirements
package:
exclude:
- node_modules/**
- .gitignore
- .git/**
functions:
first:
handler: http
events:
- http: path
pyproject.toml
[tool.poetry]
name = "cloudfunctions"
version = "0.1.0"
description = ""
authors = ["..."]
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"