Skip to content

Commit 65718bb

Browse files
nsextonTTdpopovTT
authored andcommitted
[skip ci] Optimize pkg-resources patch (#37438)
### Ticket N/A Post emergency hotfix cleanup - [x] APC U22 https://github.com/tenstorrent/tt-metal/actions/runs/21839059370/job/63018125565 - [x] APC U24 https://github.com/tenstorrent/tt-metal/actions/runs/21839308247
1 parent 03c67f8 commit 65718bb

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

create_venv.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,21 @@ PYTORCH_INDEX="https://download.pytorch.org/whl/cpu"
299299

300300
if [ "$OS_ID" = "ubuntu" ] && [ "$OS_VERSION" = "22.04" ]; then
301301
echo "Ubuntu 22.04 detected: force pip/setuptools/wheel versions"
302-
uv pip install --extra-index-url "$PYTORCH_INDEX" setuptools wheel==0.45.1
302+
uv pip install --extra-index-url "$PYTORCH_INDEX" \
303+
--index-strategy unsafe-best-match \
304+
setuptools==80 wheel==0.45.1
303305
else
304306
echo "$OS_ID $OS_VERSION detected: updating wheel and setuptools to latest"
305-
uv pip install --upgrade wheel setuptools
307+
uv pip install --upgrade wheel setuptools==80
306308
fi
307309

308310
echo "Installing dev dependencies"
309311
# Use --extra-index-url for PyTorch CPU wheels and index-strategy for transitive deps
310-
uv pip install --extra-index-url "$PYTORCH_INDEX" --index-strategy unsafe-best-match -r "$(pwd)/tt_metal/python_env/requirements-dev.txt"
312+
# no-build-isolation as a workaround for setuptools/mmcv
313+
uv pip install --extra-index-url "$PYTORCH_INDEX" \
314+
--index-strategy unsafe-best-match \
315+
--no-build-isolation \
316+
-r "$(pwd)/tt_metal/python_env/requirements-dev.txt"
311317

312318
echo "Installing tt-metal"
313319
uv pip install -e .

dockerfile/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ FROM ci-build AS ci-test
108108
ARG UBUNTU_VERSION=22.04
109109
ARG TT_METAL_INFRA_DIR=/opt/tt_metal_infra
110110

111-
# needed for setuptools dep tree
112-
RUN apt install python3-pkg-resources
113-
114111
# Create directories for infra
115112
RUN mkdir -p ${TT_METAL_INFRA_DIR}/tt-metal/docs/
116113
RUN mkdir -p ${TT_METAL_INFRA_DIR}/tt-metal/tests/sweep_framework/
@@ -125,6 +122,9 @@ COPY /tools/triage/requirements.txt ${TT_METAL_INFRA_DIR}/tools/triage/requireme
125122
# Configure PyTorch CPU index and install Python packages using uv
126123
# index-strategy unsafe-best-match is used to avoid pulling in transitive dependencies
127124
# that are not explicitly listed in the requirements.txt files
125+
# no-build-isolation is for pulling in pkg_resources from the system package
126+
# which setuptools removed in version 82. The old setuptools wheels apparently
127+
# do not automatically pull in pkg_resources
128128
RUN umask 000 && \
129129
uv pip install --no-cache --index-url https://download.pytorch.org/whl/cpu torch && \
130130
uv pip install --index-strategy unsafe-best-match --no-cache --no-build-isolation -r ${TT_METAL_INFRA_DIR}/tt-metal/tt_metal/python_env/requirements-dev.txt && \

install_dependencies.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ init_packages() {
200200
"python3-dev"
201201
"python3-pip"
202202
"python3-venv"
203+
"python3-pkg-resources" # needed for setuptools
203204
"libhwloc-dev"
204205
"libnuma-dev"
205206
"libatomic1"

0 commit comments

Comments
 (0)