Turn off the legacy pip resolver for sysinv

The requirements that had conflicts have been updated.

The local upper-constraints is no longer being used by tox
since two constraints files with different values for the same
requirements are not supported.

Additional pylint error codes are being suppressed as
pylint is now running in python3 and has some newer checks.

Cleans up some linter warnings related to yaml.

Change-Id: I9b5158d59b0791e49c3037a8e823b67fb30c8292
Related-Bug: #1907678
Signed-off-by: albailey <Al.Bailey@windriver.com>
This commit is contained in:
albailey 2020-12-10 18:25:11 -06:00
parent 9331c8fcb5
commit 7312b1bf1d
8 changed files with 31 additions and 114 deletions

View File

@ -1,81 +0,0 @@
# Job cloned from:
# https://opendev.org/openstack/openstack-zuul-jobs/src/branch/master/playbooks/legacy/puppet-lint/run.yaml
# to install gem and puppet-lint in Zuul operating enviroment,
# before running puppet-lint within the tox.ini file. The only
# modification to this job is to not run puppet-lint here.
# Rather, it's left to the tox.ini to control what files are
# checked and what options are used (ie. to skip certain checks)
#
- hosts: all
name: Setup gem and puppet-lint for availability within tox
roles:
- bindep
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
if [ -f /usr/bin/yum ]; then
sudo yum -y remove rdo-release "centos-release-openstack-*" "centos-release-ceph-*"
sudo yum -y install libxml2-devel libxslt-devel ruby-devel zlib-devel
sudo yum -y groupinstall "Development Tools"
# Uninstall python-requests from pip, since we install it in
# system-config/install_puppet.sh
sudo pip uninstall requests -y || true
elif [ -f /usr/bin/apt-get ]; then
sudo apt-get update
sudo apt-get install -y libxml2-dev libxslt-dev ruby-dev zlib1g-dev
fi
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -x
sudo rm -f /etc/sudoers.d/zuul
# Prove that general sudo access is actually revoked
! sudo -n true
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
if [ -f Modulefile -o -f metadata.json ]; then
if [ -f Modulefile ]; then
MODULE=$(awk '/^name/ {print $NF}' Modulefile |tr -d \"\')
elif [ -f metadata.json ]; then
MODULE=$(python -c 'import json;print json.load(open("metadata.json"))["name"]')
fi
if [ -z "$MODULE" ]; then
echo "Module name not defined in Modulefile or metadata.json"
else
mkdir -p "$MODULE"
rsync -a --exclude="$MODULE" --exclude ".*" . "$MODULE"
cd "$MODULE"
fi
fi
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
if [ -f Gemfile ]; then
gem install bundler --no-rdoc --no-ri --verbose --version '<2.0.0'
$GEM_HOME/bin/bundle install --without system_tests
# We'll run puppet-lint from tox
#$GEM_HOME/bin/bundle exec rake lint 2>&1
else
gem install rake -n ./.bundled_gems/
gem install puppet-lint
gem install puppetlabs_spec_helper
# We'll run puppet-lint from tox
#./.bundled_gems/rake lint 2>&1
fi
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -74,19 +74,23 @@ extension-pkg-whitelist=lxml.etree,greenlet
# W0622: redefined-builtin # W0622: redefined-builtin
# W0631: undefined-loop-variable # W0631: undefined-loop-variable
# W0632: unbalanced-tuple-unpacking # W0632: unbalanced-tuple-unpacking
# W0701: bad-except-order
# W0703: broad-except # W0703: broad-except
# W0706: try-except-raise
# W1113: keyword-arg-before-vararg # W1113: keyword-arg-before-vararg
# W1201: logging-not-lazy # W1201: logging-not-lazy
# W1401: anomalous-backslash-in-string # W1401: anomalous-backslash-in-string
# W1501: subprocess-popen-preexec-fn
# W1505: deprecated-method # W1505: deprecated-method
# W1509: subprocess-popen-preexec-fn
# All these errors should be fixed: # All these errors should be fixed:
# E0633: unpacking-non-sequence # E0633: unpacking-non-sequence
# E1101: no-member
# E1111: assignment-from-no-return
disable=C, R, fixme, W0101, W0105, W0106, W0107, W0108, W0110, W0123, W0150, disable=C, R, fixme, W0101, W0105, W0106, W0107, W0108, W0110, W0123, W0150,
W0201, W0211, W0212, W0221, W0223, W0231, W0235, W0311, W0402, W0403, W0201, W0211, W0212, W0221, W0223, W0231, W0235, W0311, W0402, W0403,
W0404, W0603, W0612, W0613, W0621, W0622, W0631, W0632, W0701, W0703, W0404, W0603, W0612, W0613, W0621, W0622, W0631, W0632, W0701, W0703,
W1113, W1201, W1401, W1505, W0706, W1113, W1201, W1401, W1505, W1509,
E0633 E0633, E1101, E1111
[REPORTS] [REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs # Set the output format. Available formats are text, parseable, colorized, msvs

View File

@ -3,9 +3,9 @@ SQLAlchemy
amqplib>=0.6.1 amqplib>=0.6.1
argparse argparse
boto3 boto3
botocore>=1.11.0 botocore
cryptography!=2.0 # BSD/Apache-2.0 cryptography!=2.0 # BSD/Apache-2.0
eventlet==0.20.0 eventlet
greenlet>=0.3.2 # MIT greenlet>=0.3.2 # MIT
keyring keyring
kombu>=2.4.8 kombu>=2.4.8
@ -44,4 +44,4 @@ rpm
ruamel.yaml>=0.13.14 # MIT ruamel.yaml>=0.13.14 # MIT
docker # Apache-2.0 docker # Apache-2.0
kubernetes # Apache-2.0 kubernetes # Apache-2.0
Django<2,>=1.11.20 # BSD Django

View File

@ -113,7 +113,7 @@ class SysinvException(Exception):
def format_message(self): def format_message(self):
if self.__class__.__name__.endswith('_Remote'): if self.__class__.__name__.endswith('_Remote'):
return self.args[0] return self.args[0] # pylint: disable=unsubscriptable-object
else: else:
return six.text_type(self) return six.text_type(self)

View File

@ -1,3 +1,4 @@
---
labels: labels:
api: api:
node_selector_key: openstack-control-plane node_selector_key: openstack-control-plane

View File

@ -71,7 +71,7 @@ class MyObj(base.SysinvObject):
@base.remotable @base.remotable
def modify_save_modify(self, context): def modify_save_modify(self, context):
self.bar = 'meow' self.bar = 'meow'
self.save() self.save() # pylint: disable=no-value-for-parameter
self.foo = 42 self.foo = 42
@ -395,7 +395,7 @@ class _TestObjectMixin(object):
ctxt = context.get_admin_context() ctxt = context.get_admin_context()
obj = MyObj.get(ctxt) obj = MyObj.get(ctxt)
self.assertEqual(obj.bar, 'bar') self.assertEqual(obj.bar, 'bar')
result = obj.marco() result = obj.marco() # pylint: disable=no-value-for-parameter
self.assertEqual(result, 'polo') self.assertEqual(result, 'polo')
self.assertRemotes() self.assertRemotes()
@ -403,7 +403,7 @@ class _TestObjectMixin(object):
ctxt = context.get_admin_context() ctxt = context.get_admin_context()
obj = MyObj.get(ctxt) obj = MyObj.get(ctxt)
self.assertEqual(obj.foo, 1) self.assertEqual(obj.foo, 1)
obj.update_test() obj.update_test() # pylint: disable=no-value-for-parameter
self.assertEqual(obj.bar, 'updated') self.assertEqual(obj.bar, 'updated')
self.assertRemotes() self.assertRemotes()

View File

@ -1,26 +1,25 @@
# The order of packages is significant, because pip processes them in the order # The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
flake8<3.8.0
pycodestyle<2.6.0 # MIT License
hacking>=1.1.0,<=2.0.0 # Apache-2.0 hacking>=1.1.0,<=2.0.0 # Apache-2.0
bandit;python_version>="3.0"
coverage>=3.6 coverage>=3.6
discover
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD mock>=2.0.0 # BSD
passlib>=1.7.0 passlib>=1.7.0
psycopg2-binary psycopg2-binary
python-barbicanclient<3.1.0,>=3.0.1 python-barbicanclient
python-subunit>=0.0.18 python-subunit>=0.0.18
requests-mock>=0.6.0 # Apache-2.0 requests-mock>=0.6.0 # Apache-2.0
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 sphinx
oslosphinx<2.6.0,>=2.5.0 # Apache-2.0 oslosphinx
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0
testrepository>=0.0.18 testrepository>=0.0.18
testtools!=1.2.0,>=0.9.36 testtools!=1.2.0,>=0.9.36
tempest-lib<0.5.0,>=0.4.0 isort<5;python_version>="3.0"
ipaddr pylint<2.1.0;python_version<"3.0" # GPLv2
pylint<2.4.0;python_version>="3.0" # GPLv2
pytest pytest
pyudev pyudev
migrate migrate

View File

@ -14,16 +14,14 @@ distshare={toxworkdir}/.tox/distshare
# enabling usedevelop results in py27 develop-inst: # enabling usedevelop results in py27 develop-inst:
# Exception: Versioning for this project requires either an sdist tarball, # Exception: Versioning for this project requires either an sdist tarball,
# or access to an upstream git repository. # or access to an upstream git repository.
# Note. site-packages is true and rpm-python must be yum installed on your dev machine. sitepackages = False
sitepackages = True basepython = python3
# tox is silly... these need to be separated by a newline.... # tox is silly... these need to be separated by a newline....
whitelist_externals = bash whitelist_externals = bash
find find
install_command = pip install --use-deprecated legacy-resolver \ install_command = pip install -v -v -v \
-v -v -v \
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \ -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
{opts} {packages} {opts} {packages}
@ -31,6 +29,7 @@ install_command = pip install --use-deprecated legacy-resolver \
# random hash seed successfully. # random hash seed successfully.
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0 PYTHONHASHSEED=0
PIP_RESOLVER_DEBUG=1
PYTHONDONTWRITEBYTECODE=1 PYTHONDONTWRITEBYTECODE=1
OS_TEST_PATH=./sysinv/tests OS_TEST_PATH=./sysinv/tests
LANG=en_US.UTF-8 LANG=en_US.UTF-8
@ -103,7 +102,6 @@ max-line-length=120
[testenv:flake8] [testenv:flake8]
basepython = python3 basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = commands =
flake8 {posargs} . \ flake8 {posargs} . \
scripts/manage-partitions \ scripts/manage-partitions \
@ -125,8 +123,8 @@ commands =
[testenv:pep8] [testenv:pep8]
# testenv:flake8 clone # testenv:flake8 clone
basepython = {[testenv:flake8]basepython} basepython = python3
deps = {[testenv:flake8]deps} deps = -r{toxinidir}/test-requirements.txt
commands = {[testenv:flake8]commands} commands = {[testenv:flake8]commands}
[testenv:venv] [testenv:venv]
@ -167,14 +165,10 @@ exclude = tests
[testenv:bandit] [testenv:bandit]
basepython = python3 basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
bandit
commands = bandit --ini tox.ini -n 5 -r sysinv commands = bandit --ini tox.ini -n 5 -r sysinv
[testenv:pylint] [testenv:pylint]
basepython = python2.7 basepython = python3
sitepackages = False
deps = {[testenv]deps}
pylint
commands = commands =
pylint {posargs} sysinv --rcfile=./pylint.rc pylint {posargs} sysinv --rcfile=./pylint.rc