From d5e552b581024264f05463507e8420f0077c996c Mon Sep 17 00:00:00 2001 From: Ken Brewer Date: Thu, 26 Oct 2023 17:43:35 +0000 Subject: [PATCH] fix(devcontainer): install poetry via devcontainer feature This change will speed up devcontainer loading and resolve some inconsistencies in how vscode treats python environments in the devcontainer Closes #334 --- .devcontainer/devcontainer.json | 4 +++- .devcontainer/postCreateCommand.sh | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 543e5927..23802b53 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,8 +2,10 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/python { "name": "Pycytominer Dev", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/python:0-3.11", + "features": { + "ghcr.io/devcontainers-contrib/features/poetry:2": {} + }, // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "bash .devcontainer/postCreateCommand.sh", // Configure tool-specific properties. diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 80902ab3..8a0bdd82 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,5 +1,4 @@ #! /usr/bin/env bash -python -m pip install poetry poetry config virtualenvs.in-project true --local poetry install --with cell_locations,collate,dev poetry run pre-commit install --install-hooks