From 6a9cd92ae0206f615a872042dbd7cde3e1c3e83a Mon Sep 17 00:00:00 2001 From: likui Date: Tue, 18 May 2021 19:25:02 +0800 Subject: [PATCH] Fix PDF docs build Update tox config to include upper-constraints as dependencies. This resolves issues with building PDF docs. New pylint 2.9.0 provides some new checkers and detects new errors with existing checkers: - consider-using-dict-items Similar change was done in Octavia repo already. Change-Id: I48106513291263a7f754cfe7f9edc3703f8fbb7a --- octavia_lib/api/drivers/data_models.py | 3 +-- tox.ini | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/octavia_lib/api/drivers/data_models.py b/octavia_lib/api/drivers/data_models.py index aefa56c..b017979 100644 --- a/octavia_lib/api/drivers/data_models.py +++ b/octavia_lib/api/drivers/data_models.py @@ -22,10 +22,9 @@ class BaseDataModel(): """Converts a data model to a dictionary.""" calling_classes = calling_classes or [] ret = {} - for attr in self.__dict__: + for attr, value in self.__dict__.items(): if attr.startswith('_') or not kwargs.get(attr, True): continue - value = self.__dict__[attr] if recurse: if isinstance(getattr(self, attr), list): diff --git a/tox.ini b/tox.ini index 7afad97..3d85025 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,9 @@ commands = coverage report --fail-under=95 --skip-covered [testenv:docs] -deps = -r{toxinidir}/doc/requirements.txt +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/doc/requirements.txt whitelist_externals = rm commands = rm -rf doc/build doc/source/reference/modules