Skip to content

Commit

Permalink
Merge pull request #250 from python-discord/ldap-deps-group
Browse files Browse the repository at this point in the history
Ldap deps group
  • Loading branch information
jb3 authored Jul 30, 2024
2 parents 9bc1c81 + 79655d9 commit 396632c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version
RUN apt-get update && apt-get install --no-install-recommends -y libldap2-dev libsasl2-dev gcc && apt autoclean && rm -rf /var/lib/apt/lists/*

COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev --no-root

# Only the LDAP group has deps that requires gcc, so only build that for now
RUN poetry install --only ldap --no-root

FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version

RUN apt-get update && apt-get install --no-install-recommends -y libmagickwand-dev && rm -rf /var/lib/apt/lists/*

# Install project dependencies
WORKDIR /app

# Copy the pre-built LDAP group from the build stage that required gcc
COPY --from=wheel-builder /opt/poetry/cache /opt/poetry/cache

# Install the rest of the dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev --no-root
RUN poetry install --without dev --with ldap --no-root

# Set Git SHA environment variable for Sentry
ARG git_sha="development"
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

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

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pre-commit = "3.7.1"
ruff = "0.5.4"
taskipy = "1.13.0"

[tool.poetry.group.ldap]
optional = true
[tool.poetry.group.ldap.dependencies]
bonsai = "^1.5.3"

Expand Down

0 comments on commit 396632c

Please sign in to comment.