Skip to content

Commit

Permalink
Merge pull request #119 from sphinxjp/devcontainer-uv
Browse files Browse the repository at this point in the history
devcontainerで使いやすくするため設定を追加
  • Loading branch information
tk0miya authored Oct 14, 2024
2 parents 9d904d6 + ad20877 commit 177f077
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

"onCreateCommand": "bash .devcontainer/on_create_command.sh"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
13 changes: 13 additions & 0 deletions .devcontainer/on_create_command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -ex

sudo apt update
sudo apt install fonts-noto-cjk
rm -rf ~/.cache/matplotlib

curl -LsSf https://astral.sh/uv/install.sh | sh
. $HOME/.cargo/env

uv venv --allow-existing ~/.local
uv pip install --prefix ~/.local/ -r requirements.txt

0 comments on commit 177f077

Please sign in to comment.