diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 28f8acd6e2ecd7..13e6d952231e07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -90,13 +90,6 @@ repos: language: script pass_filenames: false files: '^selfdrive/ui/translations/' -- repo: https://github.com/python-poetry/poetry - rev: '1.8.0' - hooks: - - id: poetry-check - name: validate poetry lock - args: - - --lock - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.28.3 hooks: diff --git a/Dockerfile.openpilot_base b/Dockerfile.openpilot_base index 0789a39c3e8b48..d3e7b57c8e5a6f 100644 --- a/Dockerfile.openpilot_base +++ b/Dockerfile.openpilot_base @@ -32,7 +32,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ vim \ lsb-core \ libx11-6 \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* ARG INTEL_DRIVER=l_opencl_p_18.1.0.015.tgz ARG INTEL_DRIVER_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/15532 @@ -63,20 +63,19 @@ RUN usermod -aG sudo $USER RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers USER $USER -ENV POETRY_VIRTUALENVS_CREATE=false -ENV PYENV_VERSION=3.11.4 -ENV PYENV_ROOT="/home/$USER/pyenv" -ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH" +ENV VIRTUAL_ENV_ROOT="/home/$USER/venv" +ENV PATH="$VIRTUAL_ENV_ROOT/bin:$PATH" -COPY --chown=$USER pyproject.toml poetry.lock .python-version /tmp/ -COPY --chown=$USER tools/install_python_dependencies.sh /tmp/tools/ +COPY --chown=$USER pyproject.toml /tmp/ RUN cd /tmp && \ - tools/install_python_dependencies.sh && \ + python3 -m venv --system-site-packages $VIRTUAL_ENV_ROOT && \ + . $VIRTUAL_ENV_ROOT/bin/activate && \ + pip install uv && \ + uv pip compile pyproject.toml -o requirements.txt && \ + uv pip install -r requirements.txt && \ rm -rf /tmp/* && \ - 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 + rm -rf /home/$USER/.cache USER root RUN sudo git config --global --add safe.directory /tmp/openpilot diff --git a/pyproject.toml b/pyproject.toml index da7f1021e68677..be69120282f898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ name = "openpilot" requires-python = ">= 3.11" readme = "README.md" license = {text = "MIT License"} +dynamic = ["dependencies"] [project.urls] Homepage = "https://comma.ai" @@ -83,9 +84,9 @@ version = "0.1.0" description = "an open source driver assistance system" authors = ["Vehicle Researcher "] license = "MIT" -readme = "README.md" repository = "https://github.com/commaai/openpilot" documentation = "https://docs.comma.ai" +packages = [{ include = "openpilot" }] [tool.poetry.dependencies] @@ -126,7 +127,7 @@ markdown-it-py = "*" timezonefinder = "*" setproctitle = "*" -[tool.poetry.group.dev.dependencies] +# dev dependencies av = "*" azure-identity = "*" azure-storage-blob = "*"