util-docker: Add Python pre-commit to Dockerfiles

Pre-commit will be used for CI to automatically run Python formatting
using Black.

Change-Id: Idc35b4586f549d312dc173dd805136ec01847f6e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61112
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Andreas Sandberg
2022-07-07 14:55:13 +01:00
parent 40077055cf
commit c7405f621b
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ RUN apt -y update && apt -y upgrade && \
libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config \
python3-pip python3-venv
RUN pip3 install black mypy
RUN pip3 install black mypy pre-commit
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 1

View File

@@ -34,4 +34,4 @@ RUN apt -y update && apt -y upgrade && \
libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config pip \
python3-venv black
RUN pip install mypy
RUN pip install mypy pre-commit