Skip to content

Commit

Permalink
MINOR: [CI] Fix ubuntu-lint to not install into system Python (#43710)
Browse files Browse the repository at this point in the history
### Rationale for this change

Currently, the `ubuntu-lint` Docker build 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'
```

### What changes are included in this PR?

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.

### Are these changes tested?

By CI.

### Are there any user-facing changes?

No.

Authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
pitrou authored Aug 16, 2024
1 parent 2767dc5 commit a50ad42
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a50ad42

Please sign in to comment.