From a631997a3524dbec81987ffa5a2b0f80a5f0d9f5 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Apr 24 2019 07:37:57 +0000 Subject: Add missing deps for `make pylint` The make target `pylint` hasn't a full list of its dependencies. This leads to problems like: - different build results - PR tests just do not run pylint over some Python scripts. The new build target (`python_scripts`) was implemented. It's intended for building all Python scripts (files, containing @PYTHONSHEBANG@ as a shebang placeholder). The make `pylint` should require it. Fixes: https://pagure.io/freeipa/issue/7921 Signed-off-by: Stanislav Levin Reviewed-By: Christian Heimes --- diff --git a/Makefile.am b/Makefile.am index f26b52b..e15d7ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,16 @@ endif IPACLIENT_SUBDIRS = ipaclient ipalib ipaplatform ipapython PYTHON_SUBDIRS = $(IPACLIENT_SUBDIRS) $(IPATESTS_SUBDIRS) $(IPASERVER_SUBDIRS) +PYTHON_SCRIPT_SUBDIRS = \ + $(top_builddir) \ + $(top_builddir)/client \ + $(top_builddir)/daemons/dnssec \ + $(top_builddir)/install/certmonger \ + $(top_builddir)/install/oddjob \ + $(top_builddir)/install/restart_scripts \ + $(top_builddir)/install/tools \ + $(NULL) + IPA_PLACEHOLDERS = freeipa ipa ipaserver ipatests SUBDIRS = asn1 util client contrib po pypi $(PYTHON_SUBDIRS) $(SERVER_SUBDIRS) @@ -274,9 +284,7 @@ polint: .PHONY: pylint if WITH_PYLINT -pylint: $(GENERATED_PYTHON_FILES) ipasetup.py - @# build CLI scripts - $(MAKE) -C $(top_builddir)/install/tools +pylint: $(GENERATED_PYTHON_FILES) ipasetup.py python_scripts FILES=`find $(top_srcdir) \ -type d -exec test -e '{}/__init__.py' \; -print -prune -o \ -path './rpmbuild' -prune -o \ @@ -383,6 +391,12 @@ python_install: $(MAKE) $(AM_MAKEFLAGS) -C $${dir} install || exit 1; \ done +.PHONY: python_scripts +python_scripts: + for dir in $(PYTHON_SCRIPT_SUBDIRS); do \ + $(MAKE) $(AM_MAKEFLAGS) -C $${dir} python_scripts_sub || exit 1; \ + done + .PHONY: strip-po: $(MAKE) -C po strip-po diff --git a/Makefile.pythonscripts.am b/Makefile.pythonscripts.am index 0d0e38b..f9769d5 100644 --- a/Makefile.pythonscripts.am +++ b/Makefile.pythonscripts.am @@ -2,3 +2,6 @@ $(PYTHON_SHEBANG):%: %.in Makefile $(AM_V_GEN)sed -e 's|@PYTHONSHEBANG[@]|#!$(PYTHON) -E|g' $< > $@ $(AM_V_GEN)chmod +x $@ + +.PHONY: python_scripts_sub +python_scripts_sub: $(PYTHON_SHEBANG)