Skip to content

Commit

Permalink
Add env var, extra deps + better glob to get compiled wheel only for …
Browse files Browse the repository at this point in the history
…pip install

- Also install uvloop
  • Loading branch information
cooperlees committed Oct 22, 2023
1 parent 5add198 commit 56b9bdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -21,6 +21,7 @@
### Packaging

<!-- Changes to how Black is packaged, such as dependency requirements -->

- Change Dockerfile to hatch + compile black (#3965)

### Parser
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Expand Up @@ -3,13 +3,14 @@ FROM python:3.11-slim AS builder
RUN mkdir /src
COPY . /src/
ENV VIRTUAL_ENV=/opt/venv
ENV HATCH_BUILD_HOOKS_ENABLE=1
# Install build tools to compile dependencies that don't have prebuilt wheels
RUN apt update && apt install -y build-essential git python3-dev
RUN python -m venv $VIRTUAL_ENV
RUN python -m pip install --no-cache-dir hatch
RUN python -m pip install --no-cache-dir hatch hatch-fancy-pypi-readme hatch-vcs
RUN . /opt/venv/bin/activate && pip install --no-cache-dir --upgrade pip setuptools \
&& cd /src && hatch build -t wheel \
&& pip install --no-cache-dir dist/*[colorama,d]
&& pip install --no-cache-dir dist/*-cp*[colorama,d,uvloop]

FROM python:3.11-slim

Expand Down

0 comments on commit 56b9bdb

Please sign in to comment.