From e3d3b200e6716c441d4407030139f47a6be979e5 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 3 May 2019 18:51:27 -0500 Subject: [PATCH] Switch python installation to use DevStack's setup_dev_lib() This function does a number of things, specifically it handles the DevStack USE_PYTHON3 switch transparently so we can run both major Python versions. The setup.cfg file in both cgcs_patch and tsconfig are really only used by setup_dev_lib() right now, making the switch to use pbr is beyond what I want to do here. Change-Id: If91248303cba9e6056ac2bc4b7e8771cf193de01 Signed-off-by: Dean Troyer --- cgcs-patch/cgcs-patch/setup.cfg | 21 +++++++++++++++++++++ devstack/lib/update | 28 ++++++++-------------------- 2 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 cgcs-patch/cgcs-patch/setup.cfg diff --git a/cgcs-patch/cgcs-patch/setup.cfg b/cgcs-patch/cgcs-patch/setup.cfg new file mode 100644 index 00000000..550ce10e --- /dev/null +++ b/cgcs-patch/cgcs-patch/setup.cfg @@ -0,0 +1,21 @@ +[metadata] +license_files = LICENSE +name = cgcs_patch +classifier = + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 + +[files] +packages = + cgcs_patch + +[wheel] +universal = 1 diff --git a/devstack/lib/update b/devstack/lib/update index 6d3d66cb..2f6c73bc 100644 --- a/devstack/lib/update +++ b/devstack/lib/update @@ -21,8 +21,11 @@ set -o xtrace STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/starlingx/update.git} STXUPDATE_DIR=${GITDIR[$STX_UPDATE_NAME]} -STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/ -TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/ +STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch +GITDIR["sw-patch"]=$STX_PATCH_DIR/cgcs-patch + +TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig +GITDIR["tsconfig"]=$TSCONFIG_DIR/tsconfig # STX_INST_DIR should be a non-root-writable place to install build artifacts STX_INST_DIR=${STX_INST_DIR:-/usr/local} @@ -36,14 +39,7 @@ STX_SUDO="sudo" PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") function install_sw_patch { - pushd $STX_PATCH_DIR/cgcs-patch - sudo python setup.py install \ - --root=/ \ - --install-lib=$PYTHON_SITE_DIR \ - --prefix=/usr \ - --install-data=/usr/share \ - --single-version-externally-managed - popd + setup_dev_lib "sw-patch" local stx_patch_sbindir=$STX_SBIN_DIR local stx_patch_sysconfdir=/etc/ @@ -59,16 +55,8 @@ function install_sw_patch { } function install_tsconfig { - # no setup.cfg in tsconfig, so we can not use pip install -e - # setup_dev_lib "tsconfig" - pushd $TSCONFIG_DIR/tsconfig - sudo python setup.py install \ - --root=/ \ - --install-lib=$PYTHON_SITE_DIR \ - --prefix=/usr \ - --install-data=/usr/share \ - --single-version-externally-managed - popd + setup_dev_lib "tsconfig" + $STX_SUDO install -d -m 755 $STX_BIN_DIR $STX_SUDO install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $STX_BIN_DIR/tsconfig }