Skip to content

Commit

Permalink
remove mention of uv_bin and .cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau committed Nov 13, 2024
1 parent 6aef6ab commit 7366c0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion Dockerfile.agnos
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ COPY --from=agnos-compiler-ffmpeg /tmp/ffmpeg.deb /tmp/ffmpeg.deb
RUN cd /tmp && apt-get -o Dpkg::Options::="--force-overwrite" install -yq ./ffmpeg.deb

ARG XDG_DATA_HOME="/usr/local"
ARG PATH="$XDG_DATA_HOME/.cargo/bin:$PATH"

# Install openpilot python packages
COPY ./userspace/uv /tmp/agnos/uv
Expand Down
33 changes: 4 additions & 29 deletions userspace/openpilot_python_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,11 @@

echo "installing uv..."

export XDG_DATA_HOME="/usr/local"
UV_BIN="$HOME/.local/bin"
PATH="$UV_BIN:$PATH"
export XDG_DATA_HOME="/usr/local" # uv is installed in $XDG_DATA_HOME/../bin since 0.5.0

curl -LsSf https://astral.sh/uv/install.sh | sh

# Create and activate virtual environment with specific Python version
PYTHON_VERSION="3.12"
uv venv $XDG_DATA_HOME/venv --seed --python-preference only-managed --python=$PYTHON_VERSION

# Ensure the virtual environment is activated
. $XDG_DATA_HOME/venv/bin/activate

# Verify Python version and create pkg-config directory if needed
python_path=$(python -c "import sys; print(sys.prefix)")
mkdir -p "${python_path}/lib/pkgconfig"
PYTHON_VERSION="3.12.3"

# Create the necessary pkg-config files
cat > "${python_path}/lib/pkgconfig/python-${PYTHON_VERSION}.pc" << EOF
prefix=${python_path}
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: Python
Description: Python library
Version: ${PYTHON_VERSION}
Libs: -L\${libdir} -lpython${PYTHON_VERSION}
Cflags: -I\${includedir}/python${PYTHON_VERSION}
EOF

# Create embed version as well
cp "${python_path}/lib/pkgconfig/python-${PYTHON_VERSION}.pc" "${python_path}/lib/pkgconfig/python-${PYTHON_VERSION}-embed.pc"
# uv requires virtual env either managed or system before installing dependencies
uv venv $XDG_DATA_HOME/venv --seed --python-preference only-managed --python=$PYTHON_VERSION

0 comments on commit 7366c0a

Please sign in to comment.