Open2

VS Remote Container + Python + Poetry + Pylance設定

たぬきうどん大盛りたぬきうどん大盛り

Dockerfile

Dockerfile

FROM python:3.10

RUN apt-get update
RUN apt-get -y install locales && \
    localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
ENV TERM xterm

RUN pip install --upgrade pip &&\
    pip install poetry

docker-compose.yaml

docker-compose.yaml

version: "3"

services:
  test-poetry:
    build: .

vscode 拡張機能

  • Python
  • Pylance

.vscode/settings.json

{
    "python.analysis.extraPaths": [
        "/root/.cache/pypoetry/virtualenvs/foo-py3.10/lib/python3.10/site-packages/"
    ],
    "python.venvPath": "/root/.cache/pypoetry/virtualenvs/foo-py3.10"
}