Skip to content

Commit

Permalink
move venv creation to Docker rather than postCreateCommand script
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwenhao committed Dec 31, 2023
1 parent 6873ff9 commit 6825e05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ USER $USERNAME

RUN cd ~ && wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh && sh install.sh

# Create and activate a Python virtual environment
RUN python -m venv ~/venv
RUN echo "source ~/venv/bin/activate" >> ~/.zshrc

RUN echo "export PYTHONPATH=\$PYTHONPATH:/workspace" >> ~/.zshrc
RUN /bin/zsh ~/.zshrc

Expand Down
2 changes: 0 additions & 2 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash
python -m venv ~/venv
echo "source ~/venv/bin/activate" >> ~/.zshrc
source /home/vscode/venv/bin/activate
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt
Expand Down

0 comments on commit 6825e05

Please sign in to comment.