Fix cookiecutter

Change-Id: I9beab1971cbeb77c081bac3bfdab4fcab9acdc6d
This commit is contained in:
Tobias Urdin 2020-03-30 10:58:26 +02:00
parent c036b072cc
commit 16642779e3
3 changed files with 16 additions and 14 deletions

View File

@ -74,22 +74,22 @@ if [ -z "${testing}" ]; then
else
tmp_var="${PWD}/puppet-${proj}"
cookiecutter_conf="${PWD}/default-config.yaml"
# https://github.com/audreyr/cookiecutter/pull/621
if ! grep -q poyo /usr/lib/python2.7/site-packages/cookiecutter-*.egg-info/requires.txt; then
# Requires gcc
if [ -z "$(which gcc 2>/dev/null)" ]; then
echo "GCC is required to install cookiecutter."
exit 1
fi
sudo pip install ruamel.yaml
set +e
which pip3 2>&1
ret=$?
set -e
if [ $ret -eq 0 ]; then
pip_bin=pip3
else
pip_bin=pip
fi
sudo pip install cookiecutter==1.3.0
sudo $pip_bin install cookiecutter==1.7.0
cat > "${cookiecutter_conf}" <<EOF
---
default_context:
project_name: $proj
version: 0.0.1
year: 2019
year: 2020
EOF
fi

View File

@ -7,8 +7,9 @@ prepare_environment() {
rm -rf puppet-whazz default-config.yaml
mkdir -p .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
export GEM_BIN_DIR=$GEM_HOME/bin
ruby <<EOF
cmd = 'gem install bundler --no-rdoc --no-ri --verbose'
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --bindir=${GEM_BIN_DIR}'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
cmd += ' -v 1.17.3'
end

View File

@ -1,12 +1,13 @@
[tox]
minversion = 2.0
minversion = 3.1
skipsdist = True
envlist = releasenotes
ignore_basepython_conflict = True
[testenv]
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages}
basepython = python3
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html