Skip to content

Commit

Permalink
Development: use uv to install everything (#11815)
Browse files Browse the repository at this point in the history
- Install `uv` under `/usr/bin`
- Replace `pip` installation of ext-theme and -ext with `uv`

Related readthedocs/readthedocs-corporate#1916
  • Loading branch information
humitos authored Dec 3, 2024
1 parent 0f531f7 commit c20603e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,25 @@ RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen

# Install ``uv`` package manager
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/usr/bin/" sh

# Ensure that ``python`` is in the PATH so that ``./manage.py`` works
RUN ln -s /usr/bin/python3 /usr/bin/python

WORKDIR /tmp

COPY requirements/docker.txt docker.txt
RUN ~/.local/bin/uv pip sync --system docker.txt
RUN uv pip sync --system docker.txt

# Install readthedocs-ext only if GITHUB_TOKEN is provided
WORKDIR /usr/src/app/checkouts/
RUN if [ -n "$GITHUB_TOKEN" ] ; \
then \
git clone --depth 1 https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/readthedocs/readthedocs-ext ; \
pip3 install --no-cache-dir -e readthedocs-ext ; \
uv pip install --system --no-cache-dir -e readthedocs-ext ; \
fi

RUN git clone --depth 1 https://github.com/readthedocs/ext-theme ; \
pip3 install --no-cache-dir -e ext-theme
uv pip install --system --no-cache-dir -e ext-theme

WORKDIR /usr/src/app/checkouts/readthedocs.org

0 comments on commit c20603e

Please sign in to comment.