-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev Container support for lsprotocol repository, referencing #234 and adding more things on the way, such as multiple Python versions, cargo, dotnet, venv, requirements, but in a way similar to how dev container is done in the VS Code Python repo: microsoft/vscode-python#21675 - [x] Add devcontainer.json, onCreateCommand.sh, postCreateCommand.sh appropriately - [x] Add installation and append to PATH for Cargo, Rust, Python(s) - [x] Install requirements from postCreateCommand.sh after activating virtual environment
- Loading branch information
1 parent
3bcc474
commit c9a8424
Showing
4 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:bookworm | ||
RUN sudo apt update | ||
|
||
# Pyenv installation of Python versions is missing below packages. | ||
RUN sudo apt install libbz2-dev libncurses5-dev libffi-dev libreadline-dev libsqlite3-dev liblzma-dev -y | ||
|
||
# Install fish. | ||
RUN sudo apt install fish -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Install pyenv and Python versions here to avoid using shim. | ||
curl https://pyenv.run | bash | ||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | ||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | ||
|
||
export PYENV_ROOT="$HOME/.pyenv" | ||
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" | ||
# eval "$(pyenv init -)" Comment this out and DO NOT use shim. | ||
source ~/.bashrc | ||
|
||
# Install Rust and Cargo | ||
curl https://sh.rustup.rs -sSf | bash -s -- -y | ||
echo 'source $HOME/.cargo/env' >> ~/.bashrc | ||
|
||
# Install Python via pyenv . | ||
pyenv install 3.8:latest 3.9:latest 3.10:latest 3.11:latest | ||
|
||
# Set default Python version to 3.8 . | ||
pyenv global 3.8.18 | ||
|
||
# Create Virutal environment. | ||
pyenv exec python3.8 -m venv .venv | ||
|
||
# Activate Virtual environment. | ||
source /workspaces/lsprotocol/.venv/bin/activate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source /workspaces/lsprotocol/.venv/bin/activate | ||
python -m pip install nox | ||
python -m pip install -r ./packages/python/requirements.txt -r ./requirements.txt |