From 37dbc4c0edb7f0065de5b13f5733cf21165ca127 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 20 Jul 2015 15:22:37 -0400 Subject: [PATCH] WIP: Don't use pip Try to just use system packages for F22. Change-Id: I60b40aa0923c4c45b2467de35ffeefd328e3b8e4 --- LIBS_FROM_GIT | 6 +++ files/rpms/general | 12 +++++ inc/python | 71 +--------------------------- stack.sh | 2 +- tools/fixup_stuff.sh | 28 ----------- tools/install_pip.sh | 107 ------------------------------------------- 6 files changed, 20 insertions(+), 206 deletions(-) create mode 100644 LIBS_FROM_GIT delete mode 100755 tools/install_pip.sh diff --git a/LIBS_FROM_GIT b/LIBS_FROM_GIT new file mode 100644 index 0000000000..2117f9df18 --- /dev/null +++ b/LIBS_FROM_GIT @@ -0,0 +1,6 @@ +# Add to your localrc. + +LIBS_FROM_GIT+=python-cinderclient,os-brick,python-openstackclient +LIBS_FROM_GIT+=oslo_log,oslo_concurrency,oslo_db,futurist,oslo_serialization,oslo_messaging,oslo_config,oslo_context,oslo_vmware,oslo_serialization,oslo_i18n +LIBS_FROM_GIT+=glance.store,glance_store,python-neutronclient,oslo_utils,python-novaclient +LIBS_FROM_GIT+=pbr diff --git a/files/rpms/general b/files/rpms/general index c3f3de893a..7a5cd48e64 100644 --- a/files/rpms/general +++ b/files/rpms/general @@ -29,3 +29,15 @@ java-1.7.0-openjdk-headless # NOPRIME rhel7 java-1.8.0-openjdk-headless # NOPRIME f21,f22 pyOpenSSL # version in pip uses too much memory iptables-services # NOPRIME f21,f22 +pytz +python-webob +python-eventlet +python-sqlalchemy +python-iso8601 +python-migrate +PyYAML +python-paramiko +python-kombu +python-suds +libvirt-python +pyparsing diff --git a/inc/python b/inc/python index 5c9dc5c3e5..765f2a6597 100644 --- a/inc/python +++ b/inc/python @@ -64,77 +64,8 @@ function pip_install_gr { pip_install $clean_name } -# Wrapper for ``pip install`` to set cache and proxy environment variables -# Uses globals ``OFFLINE``, ``PIP_VIRTUAL_ENV``, -# ``PIP_UPGRADE``, ``TRACK_DEPENDS``, ``*_proxy``, -# pip_install package [package ...] function pip_install { - local xtrace=$(set +o | grep xtrace) - set +o xtrace - local upgrade="" - local offline=${OFFLINE:-False} - if [[ "$offline" == "True" || -z "$@" ]]; then - $xtrace - return - fi - - PIP_UPGRADE=$(trueorfalse False PIP_UPGRADE) - if [[ "$PIP_UPGRADE" = "True" ]] ; then - upgrade="--upgrade" - fi - - if [[ -z "$os_PACKAGE" ]]; then - GetOSVersion - fi - if [[ $TRACK_DEPENDS = True && ! "$@" =~ virtualenv ]]; then - # TRACK_DEPENDS=True installation creates a circular dependency when - # we attempt to install virtualenv into a virualenv, so we must global - # that installation. - source $DEST/.venv/bin/activate - local cmd_pip=$DEST/.venv/bin/pip - local sudo_pip="env" - else - if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then - local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip - local sudo_pip="env" - else - local cmd_pip=$(get_pip_command) - local sudo_pip="sudo -H" - fi - fi - - cmd_pip="$cmd_pip install" - # Always apply constraints - cmd_pip="$cmd_pip -c $REQUIREMENTS_DIR/upper-constraints.txt" - - local pip_version=$(python -c "import pip; \ - print(pip.__version__.strip('.')[0])") - if (( pip_version<6 )); then - die $LINENO "Currently installed pip version ${pip_version} does not" \ - "meet minimum requirements (>=6)." - fi - - $xtrace - $sudo_pip \ - http_proxy="${http_proxy:-}" \ - https_proxy="${https_proxy:-}" \ - no_proxy="${no_proxy:-}" \ - PIP_FIND_LINKS=$PIP_FIND_LINKS \ - $cmd_pip $upgrade \ - $@ - - # Also install test requirements - local test_req="$@/test-requirements.txt" - if [[ -e "$test_req" ]]; then - echo "Installing test-requirements for $test_req" - $sudo_pip \ - http_proxy=${http_proxy:-} \ - https_proxy=${https_proxy:-} \ - no_proxy=${no_proxy:-} \ - PIP_FIND_LINKS=$PIP_FIND_LINKS \ - $cmd_pip $upgrade \ - -r $test_req - fi + echo "Not running pip!" } # get version of a package from global requirements file diff --git a/stack.sh b/stack.sh index accfd0ac3e..58b1de89aa 100755 --- a/stack.sh +++ b/stack.sh @@ -695,7 +695,7 @@ source $TOP_DIR/tools/install_prereqs.sh # Configure an appropriate Python environment if [[ "$OFFLINE" != "True" ]]; then - PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh + true fi TRACK_DEPENDS=${TRACK_DEPENDS:-False} diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh index 4fff57f401..d5a7ccd84c 100755 --- a/tools/fixup_stuff.sh +++ b/tools/fixup_stuff.sh @@ -78,29 +78,6 @@ function get_package_path { } -# Pre-install affected packages so we can fix the permissions -# These can go away once we are confident that pip 1.4.1+ is available everywhere - -# Fix prettytable 0.7.2 permissions -# Don't specify --upgrade so we use the existing package if present -pip_install 'prettytable>=0.7' -PACKAGE_DIR=$(get_package_path prettytable) -# Only fix version 0.7.2 -dir=$(echo $PACKAGE_DIR/prettytable-0.7.2*) -if [[ -d $dir ]]; then - sudo chmod +r $dir/* -fi - -# Fix httplib2 0.8 permissions -# Don't specify --upgrade so we use the existing package if present -pip_install httplib2 -PACKAGE_DIR=$(get_package_path httplib2) -# Only fix version 0.8 -dir=$(echo $PACKAGE_DIR-0.8*) -if [[ -d $dir ]]; then - sudo chmod +r $dir/* -fi - if is_fedora; then # Disable selinux to avoid configuring to allow Apache access # to Horizon files (LP#1175444) @@ -136,8 +113,3 @@ if is_fedora; then fi fi -# The version of pip(1.5.4) supported by python-virtualenv(1.11.4) has -# connection issues under proxy, hence uninstalling python-virtualenv package -# and installing the latest version using pip. -uninstall_package python-virtualenv -pip_install -U virtualenv diff --git a/tools/install_pip.sh b/tools/install_pip.sh deleted file mode 100755 index 7b42c8c485..0000000000 --- a/tools/install_pip.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env bash - -# **install_pip.sh** - -# install_pip.sh [--pip-version ] [--use-get-pip] [--force] -# -# Update pip and friends to a known common version - -# Assumptions: -# - update pip to $INSTALL_PIP_VERSION - -set -o errexit -set -o xtrace - -# Keep track of the current directory -TOOLS_DIR=$(cd $(dirname "$0") && pwd) -TOP_DIR=`cd $TOOLS_DIR/..; pwd` - -# Change dir to top of DevStack -cd $TOP_DIR - -# Import common functions -source $TOP_DIR/stackrc - -FILES=$TOP_DIR/files - -PIP_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py -LOCAL_PIP="$FILES/$(basename $PIP_GET_PIP_URL)" - -GetDistro -echo "Distro: $DISTRO" - -function get_versions { - PIP=$(which pip 2>/dev/null || which pip-python 2>/dev/null || true) - if [[ -n $PIP ]]; then - PIP_VERSION=$($PIP --version | awk '{ print $2}') - echo "pip: $PIP_VERSION" - else - echo "pip: Not Installed" - fi -} - - -function install_get_pip { - # The OpenStack gate and others put a cached version of get-pip.py - # for this to find, explicitly to avoid download issues. - # - # However, if DevStack *did* download the file, we want to check - # for updates; people can leave their stacks around for a long - # time and in the mean-time pip might get upgraded. - # - # Thus we use curl's "-z" feature to always check the modified - # since and only download if a new version is out -- but only if - # it seems we downloaded the file originally. - if [[ ! -r $LOCAL_PIP || -r $LOCAL_PIP.downloaded ]]; then - curl --retry 6 --retry-delay 5 \ - -z $LOCAL_PIP -o $LOCAL_PIP $PIP_GET_PIP_URL || \ - die $LINENO "Download of get-pip.py failed" - touch $LOCAL_PIP.downloaded - fi - sudo -H -E python $LOCAL_PIP -} - - -function configure_pypi_alternative_url { - PIP_ROOT_FOLDER="$HOME/.pip" - PIP_CONFIG_FILE="$PIP_ROOT_FOLDER/pip.conf" - if [[ ! -d $PIP_ROOT_FOLDER ]]; then - echo "Creating $PIP_ROOT_FOLDER" - mkdir $PIP_ROOT_FOLDER - fi - if [[ ! -f $PIP_CONFIG_FILE ]]; then - echo "Creating $PIP_CONFIG_FILE" - touch $PIP_CONFIG_FILE - fi - if ! ini_has_option "$PIP_CONFIG_FILE" "global" "index-url"; then - # It means that the index-url does not exist - iniset "$PIP_CONFIG_FILE" "global" "index-url" "$PYPI_OVERRIDE" - fi - -} - -# Setuptools 8 implements PEP 440, and 8.0.4 adds a warning triggered any time -# pkg_resources inspects the list of installed Python packages if there are -# non-compliant version numbers in the egg-info (for example, from distro -# system packaged Python libraries). This is off by default after 8.2 but can -# be enabled by uncommenting the lines below. -#PYTHONWARNINGS=$PYTHONWARNINGS,always::RuntimeWarning:pkg_resources -#export PYTHONWARNINGS - -# Show starting versions -get_versions - -# Do pip - -# Eradicate any and all system packages -uninstall_package python-pip - -install_get_pip - -if [[ -n $PYPI_ALTERNATIVE_URL ]]; then - configure_pypi_alternative_url -fi - -pip_install -U setuptools - -get_versions