Run API and ACI under Python 2 and 3

Make it possible to run API, ACI, and potests under Python 3.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Christian Heimes 2018-02-14 17:00:44 +01:00
parent 8ffa33c24e
commit a319a378d7
2 changed files with 14 additions and 10 deletions

View File

@ -174,10 +174,10 @@ endif
$(MAKE) $(AM_MAKEFLAGS) acilint apilint polint jslint check
$(MAKE) $(AM_MAKEFLAGS) PYTHON=$(PYTHON2) pylint
if WITH_PYTHON3
@ # just tests and pylint on Python 3
@ # just tests, aci, api and pylint on Python 3
PYTHONPATH=$(abspath $(top_srcdir)) $(PYTHON3) ipatests/ipa-run-tests \
--ipaclient-unittests
$(MAKE) $(AM_MAKEFLAGS) PYTHON=$(PYTHON3) pylint
$(MAKE) $(AM_MAKEFLAGS) PYTHON=$(PYTHON3) acilint apilint pylint
else
@echo "WARNING: python3 not available"
endif
@ -186,10 +186,12 @@ endif
.PHONY: fastcheck fasttest fastlint
fastcheck:
if WITH_PYTHON2
@$(MAKE) -j1 $(AM_MAKEFLAGS) PYTHON=$(PYTHON2) fastlint fasttest
@$(MAKE) -j1 $(AM_MAKEFLAGS) PYTHON=$(PYTHON2) \
fastlint fasttest apilint acilint
endif
if WITH_PYTHON3
@$(MAKE) -j1 $(AM_MAKEFLAGS) PYTHON=$(PYTHON3) fastlint fasttest
@$(MAKE) -j1 $(AM_MAKEFLAGS) PYTHON=$(PYTHON3) \
fastlint fasttest apilint acilint
endif
fasttest: $(GENERATED_PYTHON_FILES) ipasetup.py
@ -236,15 +238,16 @@ $(top_builddir)/ipapython/version.py:
.PHONY: acilint
acilint: $(GENERATED_PYTHON_FILES)
cd $(srcdir); ./makeaci --validate
cd $(srcdir); $(PYTHON) ./makeaci --validate
.PHONY: apilint
apilint: $(GENERATED_PYTHON_FILES)
cd $(srcdir); ./makeapi --validate
cd $(srcdir); $(PYTHON) ./makeapi --validate
.PHONY: polint
polint:
$(MAKE) -C $(srcdir)/po validate-src-strings validate-po test-gettext
$(MAKE) -C $(srcdir)/po PYTHON=$(PYTHON) \
validate-src-strings validate-po test-gettext
# Run pylint for all python files. Finds all python files/packages, skips
# folders rpmbuild, freeipa-* and dist. Skip (match, but don't print) .*,

View File

@ -6,6 +6,7 @@ DISTFILES.common.extra3 = Makefile.hack.in
IPA_TEST_I18N = @top_srcdir@/ipatests/i18n.py
MSGATTRIB = @MSGATTRIB@
PYTHON = @PYTHON@
.PHONY: strip-po
strip-po:
@ -24,13 +25,13 @@ clean: mostlyclean
# linters
test-gettext: $(DOMAIN).pot
$(IPA_TEST_I18N) --test-gettext
$(PYTHON) $(IPA_TEST_I18N) --test-gettext
validate-pot: $(DOMAIN).pot
$(IPA_TEST_I18N) --show-strings --validate-pot $(DOMAIN).pot
$(PYTHON) $(IPA_TEST_I18N) --show-strings --validate-pot $(DOMAIN).pot
validate-po: $(DOMAIN).pot
$(IPA_TEST_I18N) --show-strings --validate-po $(POFILES)
$(PYTHON) $(IPA_TEST_I18N) --show-strings --validate-po $(POFILES)
# forcefully re-generate .pot file and test it
validate-src-strings: $(DOMAIN).pot-update