Skip to content

build(docker): install uv and switch Python setup to uv sync#180

Merged
plexoos merged 5 commits into
mainfrom
use-uv
Dec 8, 2025
Merged

build(docker): install uv and switch Python setup to uv sync#180
plexoos merged 5 commits into
mainfrom
use-uv

Conversation

@plexoos

@plexoos plexoos commented Dec 8, 2025

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings December 8, 2025 20:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the Python dependency management in the Docker build by installing uv (a fast Python package installer) and switching from pip install to uv sync. The changes also configure the appropriate environment variables to support uv's virtual environment setup.

Key Changes:

  • Install uv package manager using the official installation script
  • Update PATH to include uv binary location and virtual environment binaries
  • Replace pip install workflow with uv sync for dependency management

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile Outdated
ENV OPTICKS_BUILD=/opt/eic-opticks/build
ENV LD_LIBRARY_PATH=${OPTICKS_PREFIX}/lib:${LD_LIBRARY_PATH}
ENV PATH=${OPTICKS_PREFIX}/bin:${PATH}
ENV PATH=${OPTICKS_PREFIX}/bin:~/.local/bin:$OPTICKS_HOME/.venv/bin:${PATH}

Copilot AI Dec 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tilde ~ in the PATH will not expand correctly in the Dockerfile ENV directive. Docker's ENV does not expand ~ to the home directory. Since the uv installation script installs to $HOME/.local/bin, you should either use an absolute path or the $HOME variable instead.

Suggested fix: Replace ~/.local/bin with /root/.local/bin or $HOME/.local/bin

Suggested change
ENV PATH=${OPTICKS_PREFIX}/bin:~/.local/bin:$OPTICKS_HOME/.venv/bin:${PATH}
ENV PATH=${OPTICKS_PREFIX}/bin:$HOME/.local/bin:$OPTICKS_HOME/.venv/bin:${PATH}

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile Outdated
WORKDIR $OPTICKS_HOME

# Install Python dependencies
COPY pyproject.toml $OPTICKS_HOME/

Copilot AI Dec 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uv sync command requires a uv.lock file to be present, but the Dockerfile only copies pyproject.toml. Without the lock file, uv sync will fail. You should either:

  1. Add COPY uv.lock $OPTICKS_HOME/ before this line, or
  2. Use uv pip install -e . instead if you want to install without a lock file

Note: If using uv sync, you should also ensure uv.lock is committed to your repository and updated with uv lock when dependencies change.

Suggested change
COPY pyproject.toml $OPTICKS_HOME/
COPY pyproject.toml $OPTICKS_HOME/
COPY uv.lock $OPTICKS_HOME/

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile Outdated

RUN mkdir -p /opt/optix && curl -sL https://github.com/NVIDIA/optix-dev/archive/refs/tags/v${OPTIX_VERSION}.tar.gz | tar -xz --strip-components 1 -C /opt/optix

RUN curl -LsSf https://astral.sh/uv/install.sh | sh

Copilot AI Dec 8, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uv installation at line 49 runs before the SHELL directive at line 51 switches to bash. The install script installs uv to ~/.local/bin and modifies shell initialization files, but this may not take effect properly since the SHELL is changed afterwards. Additionally, since ~/.local/bin needs to be in PATH (see line 72), you should ensure the uv installation completes successfully.

Consider adding a verification step after installation, such as:

RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
    /root/.local/bin/uv --version
Suggested change
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && /root/.local/bin/uv --version

Copilot uses AI. Check for mistakes.
@plexoos plexoos merged commit 85f0ed1 into main Dec 8, 2025
3 checks passed
@plexoos plexoos deleted the use-uv branch December 8, 2025 21:46
@plexoos plexoos added this to simphony Mar 13, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in simphony Mar 13, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in simphony Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants