Skip to content

Commit

Permalink
Merge pull request #615 from TEAMSchools/uv-install-test
Browse files Browse the repository at this point in the history
build: add uv
  • Loading branch information
cbini authored Feb 16, 2024
2 parents b7a625b + 3423348 commit 8e9f29f
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 118 deletions.
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# https://hub.docker.com/_/python
ARG PYTHON_VERSION
FROM python:${PYTHON_VERSION}-slim
FROM python:"${PYTHON_VERSION}"-slim

# set container envs
# set shell to bash
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# set dbt env from build arg
ARG CODE_LOCATION
ENV DBT_PROFILES_DIR /app/src/dbt/${CODE_LOCATION}
ENV DBT_PROFILES_DIR /app/src/dbt/"${CODE_LOCATION}"

# set container envs
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PATH /app/.venv/bin:"${PATH}"

# set workdir
WORKDIR /app

# install uv & create venv
RUN pip install "uv<1" --no-cache-dir \
&& uv venv

# install dependencies
COPY pyproject.toml requirements.txt ./
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt --no-cache-dir
uv pip install -r requirements.txt --no-cache-dir

# install python project
COPY src/teamster/ ./src/teamster/
RUN pip install . --no-cache-dir
RUN uv pip install -e . --no-cache-dir

# install dbt project
COPY src/dbt/ ./src/dbt/
Expand Down
107 changes: 51 additions & 56 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ install-1password = { shell = "bash .pdm/scripts/install-1password.sh", help = "
validate = { shell = "bash .pdm/scripts/validate.sh", help = "Validate Dagster imports and configs" }
dbt = { shell = "bash .pdm/scripts/dbt.sh" }
dbt-sxs = { shell = "pdm run bash .pdm/scripts/dbt-stage-external-sources.sh" }
post_lock = { shell = "pdm export -o requirements.txt" }
post_install = { shell = "pdm export -o requirements.txt" }

[tool.pyright]
venvPath = ".venv"
Expand Down
Loading

0 comments on commit 8e9f29f

Please sign in to comment.