From f2ef5372c51b3caffb2b21050351c2ce06103dc2 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 15 Aug 2024 16:04:05 +0200 Subject: [PATCH] MINOR: [CI] Fix ubuntu-lint to not install into system Python Currently, ubuntu-lint would install its Python dependencies directly into the system Python, which can fail depending on existing system Python packages. See example here: https://github.com/apache/arrow/actions/runs/10400929007/job/28802420047?pr=43539 where pip's dependency resolution fails with the following error message: ``` packaging.version.InvalidVersion: Invalid version: '2013-02-16' ``` Instead, this PR switches to use a virtual environment, guaranteeing that we're not interfering with the system Python and that we're not bound by already installed Python packages. --- docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index daa5c74bcb9..14eeeeee6e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1889,6 +1889,9 @@ services: command: > /bin/bash -c " git config --global --add safe.directory /arrow && + python3 -m venv /build/pyvenv && + source /build/pyvenv/bin/activate && + pip install -U pip setuptools && pip install arrow/dev/archery[lint] && archery lint --all --no-clang-tidy --no-iwyu --no-numpydoc --src /arrow"