From 3f00573d331417ccc9e6b11ee8d38956afa8bac9 Mon Sep 17 00:00:00 2001 From: Cooper Ry Lees Date: Fri, 10 May 2024 14:29:50 +0000 Subject: [PATCH 1/2] docker: Install the compiled wheel then install extras dependencies - Lets install black, then ask to install black with extrasC - pip sees black is installed and just installs extra dependencies Test: - Build local container - `docker build -t black_local .` - Run blackd in container - `docker run -p 45484:45484 --rm black_local blackd --bind-host 0.0.0.0` ``` cooper@home1:~/repos/black$ docker run -p 45484:45484 --rm black_local blackd --bind-host 0.0.0.0 blackd version 24.4.3.dev11+gad60e62 listening on 0.0.0.0 port 45484 INFO:aiohttp.access:10.255.255.1 [10/May/2024:14:40:36 +0000] "GET / HTTP/1.1" 405 204 "-" "curl/8.5.0" cooper@home1:~/repos/black$ curl http://10.6.9.2:45484 405: Method Not Allowed ``` - Test version is compiled ``` cooper@home1:~/repos/black$ docker run --rm black_local black --version black, 24.4.3.dev11+gad60e62 (compiled: yes) Python (CPython) 3.12.3 ``` Fixes #4163 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ab961a2f491..0ab5b7fd6f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,8 @@ RUN python -m venv $VIRTUAL_ENV 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/*-cp*[colorama,d,uvloop] + && pip install --no-cache-dir dist/*-cp* \ + && pip install black[colorama,d,uvloop] FROM python:3.12-slim From dc9518bedb077bca0927ba52ed5a2e609344a1d2 Mon Sep 17 00:00:00 2001 From: Cooper Ry Lees Date: Fri, 10 May 2024 14:45:13 +0000 Subject: [PATCH 2/2] Update changes --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ecc6d9496c1..5510b4bdcf2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,7 +42,7 @@ ### _Blackd_ - +- Fix blackd (and all extras installs) for docker container (#4357) ### Integrations