diff --git a/.devcontainer/0/Dockerfile b/.devcontainer/0/Dockerfile index e20cca0cbf..db12fa6e39 100644 --- a/.devcontainer/0/Dockerfile +++ b/.devcontainer/0/Dockerfile @@ -2,29 +2,25 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu USER vscode -ENV CONDA_DIR=/home/vscode/miniconda -ENV PATH="$CONDA_DIR/bin:$PATH" +ENV PATH="/home/vscode/.local/bin:${PATH}" -ARG PYTHON_VERSION=3.12 +ARG PYTHON_VERSION=3.12.11 ARG NODEJS_VERSION=24 -# Install Miniconda -RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \ - && bash ~/miniconda.sh -b -p $CONDA_DIR \ - && rm ~/miniconda.sh \ - && conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \ - && conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r +# Install and setup mise and uv +RUN curl https://mise.run | sh +RUN curl -LsSf https://astral.sh/uv/install.sh | sh -# Configure conda environment -RUN eval "$(conda shell.bash hook)" \ - && conda create -n maa \ - && conda activate maa \ - && conda install -y \ - python=$PYTHON_VERSION \ - conda-forge::nodejs=$NODEJS_VERSION \ - && pip install pre-commit +# Activate mise +RUN echo 'eval "$(mise activate bash)"' >> ~/.bashrc -# Finalize conda setup -RUN conda init \ - && conda config --set auto_activate false \ - && echo "conda activate maa" >> ~/.bashrc +# Setup Python and Node.js +RUN mise use -g node@$NODEJS_VERSION +RUN uv python install $PYTHON_VERSION + +# Create and activate venv +RUN uv venv --clear ~/.venv/maa +RUN echo "source ~/.venv/maa/bin/activate" >> ~/.bashrc + +# Install tools +RUN uv tool install prek diff --git a/.devcontainer/0/post-create.sh b/.devcontainer/0/post-create.sh index ef351ea576..80a7290d15 100644 --- a/.devcontainer/0/post-create.sh +++ b/.devcontainer/0/post-create.sh @@ -1,8 +1,6 @@ #!/bin/bash WORKSPACE=$(pwd) -# conda activate maa - echo "====================" cd "$WORKSPACE" echo "Setting up git safe.directory..." diff --git a/.devcontainer/1/Dockerfile b/.devcontainer/1/Dockerfile index 208d2f8712..18c8b715db 100644 --- a/.devcontainer/1/Dockerfile +++ b/.devcontainer/1/Dockerfile @@ -2,36 +2,40 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu USER vscode -ENV CONDA_DIR=/home/vscode/miniconda -ENV PATH="$CONDA_DIR/bin:$PATH" +ENV PATH="/home/vscode/.local/bin:${PATH}" ARG CLANGD_VERSION=20 -ARG PYTHON_VERSION=3.12 +ARG PYTHON_VERSION=3.12.11 ARG NODEJS_VERSION=24 # Install system dependencies RUN sudo apt update \ && sudo apt upgrade -y \ && sudo apt install -y \ - cmake + cmake \ + fish \ + && sudo rm -rf /var/lib/apt/lists/* -# Install Miniconda -RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \ - && bash ~/miniconda.sh -b -p ${CONDA_DIR} \ - && rm ~/miniconda.sh \ - && conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \ - && conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r +# Initialize fish +RUN fish -c exit -# Configure conda environment -RUN eval "$(conda shell.bash hook)" \ - && conda create -n maa \ - && conda activate maa \ - && conda install -y \ - python=${PYTHON_VERSION} \ - conda-forge::nodejs=${NODEJS_VERSION} \ - && pip install pre-commit ruff +# Install and setup mise and uv +RUN curl https://mise.run | sh +RUN curl -LsSf https://astral.sh/uv/install.sh | sh -# Finalize conda setup -RUN conda init \ - && conda config --set auto_activate false \ - && echo "conda activate maa" >> ~/.bashrc +# Activate mise +RUN echo 'eval "$(mise activate bash)"' >> ~/.bashrc +RUN echo 'mise activate fish | source' >> ~/.config/fish/config.fish + +# Setup Python and Node.js +RUN mise use -g node@$NODEJS_VERSION +RUN uv python install $PYTHON_VERSION + +# Create and activate venv +RUN uv venv --clear ~/.venv/maa +RUN echo "source ~/.venv/maa/bin/activate" >> ~/.bashrc +RUN echo "source ~/.venv/maa/bin/activate.fish" >> ~/.config/fish/config.fish + +# Install tools +RUN uv tool install prek +RUN uv tool install ruff diff --git a/.devcontainer/1/devcontainer.json b/.devcontainer/1/devcontainer.json index 931277fbd1..5ed6a14263 100644 --- a/.devcontainer/1/devcontainer.json +++ b/.devcontainer/1/devcontainer.json @@ -42,7 +42,7 @@ // Language-specific formatting "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", + "editor.defaultFormatter": "charliermarsh.ruff", "editor.codeActionsOnSave": { "source.organizeImports": "explicit" } @@ -54,12 +54,9 @@ "editor.defaultFormatter": "xaver.clang-format" }, - // Python formatting and linting - "isort.args": ["--profile", "black"], - // Python runtime "python.terminal.launchArgs": ["-u"], - "python.defaultInterpreterPath": "/home/vscode/miniconda/envs/maa/bin/python", + "python.defaultInterpreterPath": "/home/vscode/.venv/maa/bin/python", "python.terminal.activateEnvironment": false, // CMake settings diff --git a/.devcontainer/1/post-create.sh b/.devcontainer/1/post-create.sh index 3f4d557181..01d0a2b2ff 100644 --- a/.devcontainer/1/post-create.sh +++ b/.devcontainer/1/post-create.sh @@ -1,8 +1,6 @@ #!/bin/bash WORKSPACE=$(pwd) -# conda activate maa - echo "====================" cd "$WORKSPACE" echo "Setting up git safe.directory..." @@ -27,14 +25,14 @@ echo "Installing Python dependencies..." for req_file in tools/*/requirements.txt; do if [ -f "$req_file" ]; then echo "Installing from $req_file" - pip install -r "$req_file" + uv pip install -r "$req_file" fi done for req_file in tools/*/requirements-dev.txt; do if [ -f "$req_file" ]; then echo "Installing from $req_file" - pip install -r "$req_file" + uv pip install -r "$req_file" fi done