Skip to content

Serverless Framework Python3.11 Template Repository.

Notifications You must be signed in to change notification settings

kattakaha/serverless-python311-template

Repository files navigation

serverless-python311-template

Serverless Framework Python3.11 Template Repository.

python AWS lambda GitHub git github-actions

環境構築

  • nodenv
  • pyenv
  • wsl2 Ubuntu
  • Docker

ここら辺参考になるかも

Installation

pyenvを使ってPythonのバージョン合わせる場合はこちらの記事を参考にPython 3.11.6を使用してください。

# install poetry
pip install poetry
# Poetry to use project-specific virtual env
poetry config virtualenvs.in-project true
# install virtual env
poetry install
# install npm dependencies
npm install

Usage

Task Runner

Python

# format
poetry run task format
# lint
poetry run task lint
# pytest
poetry run task test

npm

# run local api server (use .vnev interpreter)
npm run dev

Swagger URL: http://localhost:3333/local/v1/swagger

Run local server

health check 用エンドポイント: http://localhost:3333/local/v1/healthcheck

# activate python venv shell
poetry shell
# run local api server (serverless offline)
npm run dev