Skip to content

Commit

Permalink
Add isort and black to build-base container
Browse files Browse the repository at this point in the history
Those tools will be used to improve Python code formatting. And use pip
to install them, so we can enforece the same package version on all
platforms.

Signed-off-by: Martin Perina <[email protected]>
  • Loading branch information
mwperina authored and engelmi committed Mar 27, 2024
1 parent a231ab2 commit 697bc57
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions build-scripts/build-push-containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function build(){
buildah bud --tag "quay.io/bluechi/$IMAGE" \
--manifest $IMAGE \
--arch ${arch} \
--build-context root_dir=${SCRIPT_DIR}/.. \
${CONTAINER_FILE_DIR}/${IMAGE}
done
}
Expand Down
7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# NOTE: build-base container image needs to be rebuilt after changing this file!

# Try to keep linter package versions aligned with latest Fedora RPM versions
black==24.1.1
flake8==6.0.0
isort==5.13.2

9 changes: 8 additions & 1 deletion tests/containers/build-base
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ RUN dnf install -y dnf-plugin-config-manager && \
lcov \
make \
meson \
python3-flake8 \
python3-html2text \
python3-pip \
rpm-build \
sed \
selinux-policy-devel \
Expand All @@ -32,3 +32,10 @@ RUN dnf install -y dnf-plugin-config-manager && \
valgrind \
-y && \
dnf -y clean all

# Install python dependencies
COPY --from=root_dir requirements.txt .
RUN python3 -m venv /opt/bluechi-env && \
. /opt/bluechi-env/bin/activate && \
pip install -r requirements.txt && \
deactivate

0 comments on commit 697bc57

Please sign in to comment.