Skip to content

Commit d962546

Browse files
atalmanpytorchmergebot
authored andcommitted
[CD] Fix docker builds by installing setuptools after python build (pytorch#134631)
Follow up after pytorch#134595 Same error happens silently before the error addressed in the above PR (and build continues and builds invalid Docker): ``` #47 457.5 Traceback (most recent call last): #47 457.5 File "<string>", line 1, in <module> #47 457.5 File "/opt/_internal/cpython-3.12.0/lib/python3.12/site-packages/wheel/pep425tags.py", line 3, in <module> #47 457.5 import distutils.util #47 457.5 ModuleNotFoundError: No module named 'distutils' #47 457.5 + local abi_tag= #47 457.5 + ln -s /opt/_internal/cpython-3.12.0 /opt/python/ #47 457.5 + rm -f Python-3.12.0.tgz ``` The fix in pytorch#134595 is no longer needed since we will install setuptools right after python installation. Link: https://github.com/pytorch/pytorch/actions/runs/10584642913/job/29329366729#step:6:6041 Pull Request resolved: pytorch#134631 Approved by: https://github.com/kit1980
1 parent 2b95da7 commit d962546

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.ci/docker/common/install_cpython.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function do_cpython_build {
5858
if [ -e ${prefix}/bin/pip3 ] && [ ! -e ${prefix}/bin/pip ]; then
5959
ln -s pip3 ${prefix}/bin/pip
6060
fi
61-
${prefix}/bin/pip install wheel==0.34.2
61+
# install setuptools since python 3.12 is required to use distutils
62+
${prefix}/bin/pip install wheel==0.34.2 setuptools==68.2.2
6263
local abi_tag=$(${prefix}/bin/python -c "from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag; print('{0}{1}-{2}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()))")
6364
ln -s ${prefix} /opt/python/${abi_tag}
6465
}

.ci/docker/manywheel/build_scripts/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ find /opt/_internal \
117117
-print0 | xargs -0 rm -f
118118

119119
for PYTHON in /opt/python/*/bin/python; do
120-
# install setuptools since python 3.12 is required to use distutils
121-
$PYTHON -m pip install setuptools==68.2.2
122120
# Smoke test to make sure that our Pythons work, and do indeed detect as
123121
# being manylinux compatible:
124122
$PYTHON $MY_DIR/manylinux1-check.py

0 commit comments

Comments
 (0)