build: drop "check-python-black" check from autotools

Previously, autotools would detect whether we have "black"
in the path. And if so, it would check formatting during `make check`.

That's problematic. When I run `./contrib/fedora/rpm/build_clean.sh -w test`
in certain cases, it would pick up black, but then fail with

  Traceback (most recent call last):
    File "/usr/bin/black", line 5, in <module>
      from black import patched_main
    File "/usr/lib/python3.6/site-packages/black.py", line 42, in <module>
      from attr import dataclass, evolve, Factory
  ModuleNotFoundError: No module named 'attr'
  make[3]: *** [Makefile:21658: check-python-black] Error 1

That's an installation error of black, but still, during package build
there is no need to check the formatting. We could export
`NMTST_SKIP_PYTHON_BLACK=1` to prevent it, but it's still unnecessary.

We check proper formatting in gitlab-ci. That is enough, it doesn't
need to run during `make check`. In particular, because `black .`
takes 1.5 seconds on my machine.
This commit is contained in:
Thomas Haller 2022-04-01 13:45:00 +02:00
parent 49b0a92b5a
commit 12299ee91e
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
3 changed files with 0 additions and 16 deletions

View file

@ -21,12 +21,6 @@ meson --version
! command -v yum &>/dev/null || yum list installed
! command -v apk &>/dev/null || apk -v info
# The formatting depends on the version of python black.
# We have a dedicated test that checks our formatting, which
# uses the right version. We should disable the check during
# `make check`.
export NMTST_SKIP_PYTHON_BLACK=1
# We have a unit test that check that `ci-fairy generate-template`
# is equal to our .gitlab-ci.yml file. However, on gitlab-ci we
# also have a dedicate test for the same thing. We don't need

View file

@ -5679,12 +5679,6 @@ CLEANFILES += \
include Makefile.examples
if WITH_PYTHON_BLACK
check-python-black:
test "$$NMTST_SKIP_PYTHON_BLACK" == 1 || $(BLACK) --check $(top_srcdir) $(top_srcdir)/examples/python/gi/nm-wg-set
check_local += check-python-black
endif
###############################################################################
check-tree:

View file

@ -1320,10 +1320,6 @@ else
have_introspection=no
fi
# check for python black. And check if all files are formatted with python black
AC_PATH_PROG(BLACK, black)
AM_CONDITIONAL(WITH_PYTHON_BLACK, test "${BLACK}" != "")
# check for pregenerated manpages and documentation to be installed
use_pregen_docs=no
if test "$build_docs" != "yes" -a \