Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: make dockerfile setup dev environment #131

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions .devcontainer/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM continuumio/miniconda3
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
btop \
cmake \
gdb \
gh \
Expand Down Expand Up @@ -33,29 +34,27 @@ RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUS
# Configure zsh
RUN sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc

# Create a new conda environment with Python 3.12 and fix the bug with VS-code terminal showing 2 conda env prompts
# Create a new conda environment with Python 3.12 (dev+docs) and fix the bug with VS-code terminal showing 2 conda env prompts
RUN . /opt/conda/etc/profile.d/conda.sh && \
conda config --set auto_activate_base False && \
/opt/conda/bin/conda create -n c312 python=3.12 -y && \
conda activate c312
/opt/conda/bin/conda create -n piqtree python=3.12 -y && \
conda activate piqtree

# Initialize conda for zsh shell
RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.zshrc
# Initialise conda for zsh shell
RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.zshrc && \
echo 'alias sac="conda activate"' >> ~/.zshrc && \
echo 'alias sde="conda deactivate"' >> ~/.zshrc

# Clone cogent3 using SSH
WORKDIR /home/user/repos
RUN git clone --branch develop https://github.com/cogent3/cogent3.git /home/user/repos/cogent3
# Setup submodule
RUN git submodule update --init --recursive

# Install pybind11 in the conda environment
RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate c312 && \
pip install pybind11

# Install the cogent3 repository
# Build piqtree
RUN ./build_tools/build_iqtree.sh

# Set up conda environments
RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate c312 && \
cd /home/user/repos/cogent3 && \
pip install -e .
conda activate piqtree && \
pip install -e ".[dev]"

# Set up zsh as the default shell
SHELL ["/bin/zsh", "-c"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Documentation = "https://piqtree2.readthedocs.io"


[project.optional-dependencies]
dev = ["cibuildwheel", "pybind11", "scriv", "piqtree2[test]", "piqtree2[lint]", "piqtree2[typing]"]
dev = ["cibuildwheel", "pybind11", "scriv", "piqtree2[doc]", "piqtree2[test]", "piqtree2[lint]", "piqtree2[typing]"]
test = ["pytest", "pytest-cov", "nox"]
lint = ["ruff==0.8.2"]
typing = ["mypy==1.13.0", "piqtree2[stubs]", "piqtree2[test]"]
Expand Down
Loading