-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deps): install project and dev and test dependencies in devconta…
…iner (#10544) ## Description of changes * Install `uv` in development container * Use `uv sync` to install project and its dependencies, dev and tests dependency groups, and selected optional dependencies/extras * Switch the container user to the `vscode` user * Give the `vscode` user ownership and permissions to the `uv` virtual environment and other directories needed for running `uv run pytest -m core` * Enables use of Git within container, so commits can be pushed to/pulled from remote ## Issues closed * Resolves #10532
- Loading branch information
1 parent
e663faf
commit e593495
Showing
3 changed files
with
112 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/python:3.11 | ||
COPY --from=ghcr.io/astral-sh/uv:0.5.6 /uv /uvx /bin/ | ||
ARG USERNAME=vscode | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends libgdal-dev | ||
apt-get install -y --no-install-recommends libgdal-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN python3 -m pip install pipx --no-cache-dir | ||
RUN python3 -m pipx ensurepath | ||
RUN pipx install rust-just | ||
|
||
WORKDIR /app | ||
|
||
# Enable bytecode compilation | ||
ENV UV_COMPILE_BYTECODE=1 | ||
|
||
# Copy from the cache instead of linking since it's a mounted volume | ||
ENV UV_LINK_MODE=copy | ||
|
||
COPY . /app | ||
|
||
# Install the project's dependencies using the lockfile and settings | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
--mount=type=bind,source=uv.lock,target=uv.lock \ | ||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync --group dev --group tests \ | ||
--extra duckdb --extra clickhouse --extra examples --extra geospatial | ||
|
||
ENV VENV_DIR=.venv | ||
RUN chown -R $USERNAME $VENV_DIR && chmod -R 755 $VENV_DIR | ||
|
||
ENV IBIS_PROJECT=. | ||
RUN chown -R $USERNAME $IBIS_PROJECT | ||
|
||
# Place executables in the environment at the front of the path | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
|
||
ENTRYPOINT [] | ||
|
||
USER $USERNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters