[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From 794f76e8526ac11fa063357b2c7bb662b01befe4 Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 6 ++-- configure.ac | 1 + freeipa.spec.in | 3 ++ ipatests/conftest.py | 4 ++- pypi/test_placeholder.py | 47 tox.ini | 55 8 files changed, 209 insertions(+), 3 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index ab69f49..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -299,12 +301,12 @@ pypi_packages: $(WHEELPYPIDIR) .wheelconstraints rm -f $(WHEELPYPIDIR)/* for dir in $(IPACLIENT_SUBDIRS); do \ $(MAKE) $(AM_MAKEFLAGS) \ - IPA_OMIT_INSTALL=1 WHEELDISTDIR=$(abspath $(WHEELPYPIDIR)) \ + IPA_OMIT_INSTALL=1 WHEELDISTDIR="$(abspath $(WHEELPYPIDIR))" \ -C $${dir} bdist_wheel || exit 1; \ done for dir in $(IPA_PLACEHOLDERS); do \ $(MAKE) $(AM_MAKEFLAGS) \ - IPA_OMIT_INSTALL=1
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From ec1c53805892f3439409e2d2d0d941124583093c Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + freeipa.spec.in | 3 ++ ipatests/conftest.py | 4 ++- pypi/test_placeholder.py | 47 tox.ini | 55 8 files changed, 222 insertions(+), 6 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From c0f301f1b103268b0853ba569f9a4c9946cec7a8 Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + ipatests/conftest.py | 4 ++- pypi/test_placeholder.py | 47 tox.ini | 56 + 7 files changed, 220 insertions(+), 6 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f $(foreach item,$(IPA_WHEEL_PACKAGES)
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From 5aef9ff020a241162145fc4c3113774cf5e5faf5 Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + ipatests/conftest.py | 4 ++- pypi/test_placeholder.py | 47 tox.ini | 56 + 7 files changed, 220 insertions(+), 6 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f $(foreach item,$(IPA_WHEEL_PACKAGES)
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From 61384864d2539729004df0a98bf8f94e82e42e94 Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + ipatests/conftest.py | 4 ++- pypi/test_placeholder.py | 47 tox.ini | 55 7 files changed, 219 insertions(+), 6 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f $(foreach item,$(IPA_WHEEL_PACKAGES)
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From 9c9b0f2891c021aadac38824d3bea2862830f85a Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + ipatests/conftest.py | 4 ++- pypi/test_placeholder.py | 47 tox.ini | 54 7 files changed, 218 insertions(+), 6 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f $(foreach item,$(IPA_WHEEL_PACKAGES)
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From 6f90b92ac55f32a1a028ffe0faffde21faab8544 Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + ipatests/conftest.py | 5 +-- pypi/test_placeholder.py | 47 tox.ini | 54 7 files changed, 218 insertions(+), 7 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f $(foreach item,$(IPA_WHEEL_PACKAGES)
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From a65d13d3640d5dd6500244208de81f18fc779b84 Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + ipatests/conftest.py | 5 +-- pypi/test_placeholder.py | 47 tox.ini | 54 7 files changed, 218 insertions(+), 7 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..7608dfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f $(foreach item,$(IPA_WHEEL_PACKAGES)
[Freeipa-devel] [freeipa PR#618][synchronized] Tox testing support for client wheel packages
URL: https://github.com/freeipa/freeipa/pull/618 Author: tiran Title: #618: Tox testing support for client wheel packages Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/618/head:pr618 git checkout pr618 From 372e263ea0082367ddb3251b183275850e277317 Mon Sep 17 00:00:00 2001 From: Christian HeimesDate: Thu, 17 Nov 2016 16:43:17 +0100 Subject: [PATCH 1/2] tox testing support for client wheel packages Add tox infrastructure to test client wheel packages workflow: * build client packages * install client packages * ipa-run-tests --ipaclient-unittests under Python 2 and 3 * pylint of client packages under Python 2 and 3 * placeholder packages work as expected Signed-off-by: Christian Heimes --- .gitignore | 2 ++ .tox-install.sh | 94 Makefile.am | 22 +--- configure.ac | 1 + ipatests/conftest.py | 5 +-- pypi/test_placeholder.py | 47 tox.ini | 54 7 files changed, 218 insertions(+), 7 deletions(-) create mode 100755 .tox-install.sh create mode 100644 pypi/test_placeholder.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 8941fd8..8b57dbc 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ freeipa2-dev-doc # Root directory /freeipa.spec /dist/ +/.tox/ +/.cache/ /*/dist/ /RELEASE /rpmbuild/ diff --git a/.tox-install.sh b/.tox-install.sh new file mode 100755 index 000..8f9d221 --- /dev/null +++ b/.tox-install.sh @@ -0,0 +1,94 @@ +#!/bin/bash +set -ex + +FLAVOR="$1" +ENVPYTHON="$2" +ENVSITEPACKAGESDIR="$3" +# 3...end are package requirements +shift 3 + +TOXINIDIR="$(cd "$(dirname "$0")" && pwd)" + +# sanity checks +if [ ! -x "${ENVPYTHON}" ]; then +echo "${ENVPYTHON}: no such executable" +exit 1 +fi + +if [ ! -d "${ENVSITEPACKAGESDIR}" ]; then +echo "${ENVSITEPACKAGESDIR}: no such directory" +exit 2 +fi + +if [ ! -f "${TOXINIDIR}/tox.ini" ]; then +echo "${TOXINIDIR}: no such directory" +exit 3 +fi + +# https://pip.pypa.io/en/stable/user_guide/#environment-variables +export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache" +mkdir -p "${PIP_CACHE_DIR}" + +DISTBUNDLE="${TOXINIDIR}/dist/bundle" +mkdir -p "${DISTBUNDLE}" + +DISTPYPI="${TOXINIDIR}/dist/pypi" +mkdir -p "${DISTPYPI}" + +# create configure +pushd "${TOXINIDIR}" +if [ ! -f "configure" ]; then +autoreconf -i -f +fi +# (re)create Makefile +./configure --disable-server +popd + +case $FLAVOR in +wheel_bundle) +# copy pylint plugin +cp "${TOXINIDIR}/pylint_plugins.py" "${ENVSITEPACKAGESDIR}" + +# build packages and bundles +make -C "${TOXINIDIR}" \ +wheel_bundle \ +PYTHON="${ENVPYTHON}" \ +IPA_EXTRA_WHEELS="$*" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages with dist/bundle/ as extra source for wheels while ignoring +# upstream Python Package Index. +$ENVPYTHON -m pip install \ +--no-index \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTBUNDLE}" \ +$@ + +popd +;; +pypi_packages) +# build packages and bundles +make -C "${TOXINIDIR}" \ +pypi_packages \ +PYTHON="${ENVPYTHON}" + +# chdir to prevent local .egg-info from messing up pip +pushd "${ENVSITEPACKAGESDIR}" + +# Install packages from dist/pypi +$ENVPYTHON -m pip install \ +--disable-pip-version-check \ +--constraint "${TOXINIDIR}/.wheelconstraints" \ +--find-links "${DISTPYPI}" \ +$@ + +popd +;; +*) +echo "Unknown install flavor $FLAVOR" +exit 1 +;; +esac diff --git a/Makefile.am b/Makefile.am index 1989b19..4c825cc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -57,6 +57,7 @@ EXTRA_DIST = .mailmap \ clean-local: rm -rf "$(RPMBUILD)" rm -rf "$(top_builddir)/dist" + rm -rf "$(top_builddir)/.tox" rm -rf "$(top_srcdir)/__pycache__" rm -f "$(top_builddir)"/$(PACKAGE)-*.tar.gz @@ -212,6 +213,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -path './freeipa-*' -prune -o \ -path './dist' -prune -o \ -path './pypi' -prune -o \ + -path './.tox' -prune -o \ -name '.*' -o \ -name '*.in' -o \ -name '*~' -o \ @@ -254,6 +256,7 @@ endif # WITH_JSLINT .PHONY: bdist_wheel wheel_bundle wheel_placeholder pypi_packages WHEELDISTDIR = $(top_builddir)/dist/wheels +WHEELPYPIDIR = $(top_builddir)/dist/pypi WHEELBUNDLEDIR = $(top_builddir)/dist/bundle @MK_IFEQ@ ($(IPA_SERVER_WHEELS),1) @@ -273,6 +276,9 @@ $(WHEELDISTDIR): $(WHEELBUNDLEDIR): mkdir -p $(WHEELBUNDLEDIR) +$(WHEELPYPIDIR): + mkdir -p $(WHEELPYPIDIR) + bdist_wheel: $(WHEELDISTDIR) rm -f $(foreach