From 8c5317152b0811ef11d3078b67e30b36c83bb6e8 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 3 May 2019 14:47:10 -0600 Subject: [PATCH] Avoid tox_install.sh for constraints support We do not need tox_install.sh, pip can handle constraints itself and install the project correctly. Thus update tox.ini and remove the now obsolete tools/tox_install.sh file. This follows https://review.openstack.org/#/c/508061 to remove tools/tox_install.sh. Change-Id: I67c50430ced6efcc2f29ec7d8adc871415922d6f Signed-off-by: Stephen Finucane --- doc/requirements.txt | 3 +++ test-requirements.txt | 5 ++--- tools/tox_install.sh | 35 ----------------------------------- tox.ini | 20 ++++++++++---------- 4 files changed, 15 insertions(+), 48 deletions(-) delete mode 100755 tools/tox_install.sh diff --git a/doc/requirements.txt b/doc/requirements.txt index dc949b25..30ef4c81 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,3 +6,6 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD openstackdocstheme>=1.18.1 # Apache-2.0 reno>=2.5.0 # Apache-2.0 + +# Optional dependencies that are needed to build docs +fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/test-requirements.txt b/test-requirements.txt index e119f198..e17e18a0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,10 +9,9 @@ testtools>=2.3.0 # MIT mock>=2.0.0 # BSD oslotest>=3.3.0 # Apache-2.0 -# when we can require tox>= 1.4, this can go into tox.ini: -# [testenv:cover] -# deps = {[testenv]deps} coverage coverage>=4.5.1 # Apache-2.0 # Bandit security code scanner bandit>=1.1.0,<1.6.0 # Apache-2.0 + +fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/tools/tox_install.sh b/tools/tox_install.sh deleted file mode 100755 index 05c58b33..00000000 --- a/tools/tox_install.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -# Client constraint file contains this client version pin that is in conflict -# with installing the client from source. We should remove the version pin in -# the constraints file before applying it for from-source installation. - -CONSTRAINTS_FILE="$1" -shift 1 - -set -e - -# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get -# published to logs.openstack.org for easy debugging. -localfile="$VIRTUAL_ENV/log/upper-constraints.txt" - -if [[ "$CONSTRAINTS_FILE" != http* ]]; then - CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE" -fi -# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep -curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile" - -pip install -c"$localfile" openstack-requirements - -# This is the main purpose of the script: Allow local installation of -# the current repo. It is listed in constraints file and thus any -# install will be constrained and we need to unconstrain it. -edit-constraints "$localfile" -- "$CLIENT_NAME" - -if [ -z "$@" ]; then - echo "No packages to be installed." - exit 0 -fi - -pip install -c"$localfile" -U "$@" -exit $? diff --git a/tox.ini b/tox.ini index e0efb66c..b2fb18ee 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,13 @@ [tox] minversion = 2.0 -envlist = py36,py27,pep8 +envlist = py27,py36,pep8 [testenv] whitelist_externals = find -setenv = - VIRTUAL_ENV={envdir} - BRANCH_NAME=master - CLIENT_NAME=oslo.log -install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages} -deps = -r{toxinidir}/test-requirements.txt - -e.[fixtures] +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/upper-constraints.txt} + -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete stestr run {posargs} @@ -30,12 +26,16 @@ commands = {posargs} [testenv:docs] basepython = python3 -deps = -r{toxinidir}/doc/requirements.txt +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/upper-constraints.txt} + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -b html doc/source doc/build/html [testenv:releasenotes] basepython = python3 -deps = -r{toxinidir}/doc/requirements.txt +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/upper-constraints.txt} + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -b html releasenotes/source releasenotes/build/html [testenv:cover]