michaelr27 HF Staff commited on
Commit
c633f76
·
verified ·
1 Parent(s): 022e657

dockerfile: bootstrap pip for python 3.12 via ensurepip

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -1
Dockerfile CHANGED
@@ -30,7 +30,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
30
  && add-apt-repository -y ppa:deadsnakes/ppa \
31
  && apt-get update && apt-get install -y --no-install-recommends \
32
  python3.12 python3.12-venv python3.12-dev \
33
- python3-pip \
34
  git ca-certificates \
35
  libglib2.0-0 libsm6 libxext6 libgomp1 libfontconfig1 \
36
  libgl1 libegl1 libegl-mesa0 libxrender1 \
@@ -38,6 +37,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
38
  && ln -sf /usr/bin/python3.12 /usr/local/bin/python \
39
  && ln -sf /usr/bin/python3.12 /usr/local/bin/python3
40
 
 
 
 
 
 
 
 
 
41
  # cadgenbench from the Public GitHub repo, same convention and
42
  # ARG name as the leaderboard Dockerfile. Bump CADGENBENCH_SHA in
43
  # lockstep with cadgenbench releases.
 
30
  && add-apt-repository -y ppa:deadsnakes/ppa \
31
  && apt-get update && apt-get install -y --no-install-recommends \
32
  python3.12 python3.12-venv python3.12-dev \
 
33
  git ca-certificates \
34
  libglib2.0-0 libsm6 libxext6 libgomp1 libfontconfig1 \
35
  libgl1 libegl1 libegl-mesa0 libxrender1 \
 
37
  && ln -sf /usr/bin/python3.12 /usr/local/bin/python \
38
  && ln -sf /usr/bin/python3.12 /usr/local/bin/python3
39
 
40
+ # Bootstrap pip for Python 3.12. Ubuntu 22.04's apt `python3-pip`
41
+ # is built against the system Python 3.10 and depends on the
42
+ # `distutils` module that 3.12 removed; invoking it under 3.12
43
+ # raises ModuleNotFoundError: distutils. ensurepip ships with the
44
+ # 3.12 stdlib and gives us a matching pip.
45
+ RUN python -m ensurepip --upgrade \
46
+ && python -m pip install --no-cache-dir --upgrade pip
47
+
48
  # cadgenbench from the Public GitHub repo, same convention and
49
  # ARG name as the leaderboard Dockerfile. Bump CADGENBENCH_SHA in
50
  # lockstep with cadgenbench releases.