Revert no pyenv (#32547)

* Revert "`ubuntu_setup`: fix `No module apt_pkg` error when setting up (#32526)"

This reverts commit d850f07acb58e4fc6d530241a31c0917c2b6613e.

* Revert "Removal of pyenv (#32512)"

This reverts commit 41f72d5ca75aab9a9beb3181aca9f177e5a003f8.
old-commit-hash: 1eb938b8e81a3321adf1064e8ef348b8c7073d4c
This commit is contained in:
Adeeb Shihadeh
2024-05-26 21:21:50 -07:00
committed by GitHub
parent 51b5d472fb
commit 549bc535cd
7 changed files with 55 additions and 44 deletions
+8 -5
View File
@@ -13,7 +13,7 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
COPY tools/install_ubuntu_dependencies.sh /tmp/tools/
RUN INSTALL_EXTRA_PACKAGES=no INSTALL_DEADSNAKES_PPA=yes /tmp/tools/install_ubuntu_dependencies.sh && \
RUN INSTALL_EXTRA_PACKAGES=no /tmp/tools/install_ubuntu_dependencies.sh && \
rm -rf /var/lib/apt/lists/* /tmp/* && \
cd /usr/lib/gcc/arm-none-eabi/9.2.1 && \
rm -rf arm/ thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp
@@ -64,16 +64,19 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER $USER
ENV POETRY_VIRTUALENVS_CREATE=false
ENV VIRTUAL_ENV_ROOT="/home/$USER/venv"
ENV PATH="$VIRTUAL_ENV_ROOT/bin:$PATH"
ENV PYENV_VERSION=3.11.4
ENV PYENV_ROOT="/home/$USER/pyenv"
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
COPY --chown=$USER pyproject.toml poetry.lock /tmp/
COPY --chown=$USER pyproject.toml poetry.lock .python-version /tmp/
COPY --chown=$USER tools/install_python_dependencies.sh /tmp/tools/
RUN cd /tmp && \
tools/install_python_dependencies.sh && \
rm -rf /tmp/* && \
rm -rf /home/$USER/.cache
rm -rf /home/$USER/.cache && \
find /home/$USER/pyenv -type d -name ".git" | xargs rm -rf && \
rm -rf /home/$USER/pyenv/versions/3.11.4/lib/python3.11/test
USER root
RUN sudo git config --global --add safe.directory /tmp/openpilot