From efa7d4d52171f3f648d3a74c1f14f81b36de1385 Mon Sep 17 00:00:00 2001 From: Yasufumi Ogawa Date: Fri, 16 May 2025 23:24:17 +0900 Subject: [PATCH 1/2] Update versions in requirements files Fix some packages in requirements.txt and test-requirements.txt are too old and causing a failure in `tox -e pep8`. It also fixes invalid styles treated as an error in the recent flake8's checking. Change-Id: I68989196a962469b4f74e5120431fc18804ea465 Signed-off-by: Yasufumi Ogawa --- requirements.txt | 10 +++++----- test-requirements.txt | 12 ++++++------ toscaparser/elements/constraints.py | 6 +++--- toscaparser/functions.py | 10 +++++----- toscaparser/substitution_mappings.py | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0728d4fe..8de225d6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,9 +4,9 @@ # 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 # process, which may cause wedges in the gate later. -pbr!=2.1.0,>=2.0.0 # Apache-2.0 -cliff!=2.9.0,>=2.8.0 # Apache-2.0 +pbr>=6.0.0 # Apache-2.0 +cliff>=4.9.1 # Apache-2.0 PyYAML>=3.12 # MIT -python-dateutil>=2.5.3 # BSD -stevedore>=1.20.0 # Apache-2.0 -requests>=2.14.2 # Apache-2.0 +python-dateutil>=2.9.0 # BSD +stevedore>=2.0.1 # Apache-2.0 +requests>=2.32.3 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index ac6158c4..fc31c2b8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,11 +1,11 @@ # 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 # process, which may cause wedges in the gate later. -hacking>=4.0.0,<4.1.0 # Apache-2.0 -coverage!=4.4,>=4.0 # Apache-2.0 +hacking>=7.0.0,<7.1.0 # Apache-2.0 +coverage>=4.4.1 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -oslotest>=3.2.0 # Apache-2.0 -python-subunit>=1.0.0 # Apache-2.0/BSD +oslotest>=5.0.0 # Apache-2.0 +python-subunit>=1.4.4 # Apache-2.0/BSD stestr>=2.0.0 # Apache-2.0 -testscenarios>=0.4 # Apache-2.0/BSD -testtools>=2.2.0 # MIT +testscenarios>=0.5.0 # Apache-2.0/BSD +testtools>=2.7.2 # MIT diff --git a/toscaparser/elements/constraints.py b/toscaparser/elements/constraints.py index e59c78fc..2b7c3e8d 100644 --- a/toscaparser/elements/constraints.py +++ b/toscaparser/elements/constraints.py @@ -140,7 +140,7 @@ def __new__(cls, property_name=None, property_type=None, constraint=None): if cls is not Constraint: return super(Constraint, cls).__new__(cls) - if(not isinstance(constraint, collections.abc.Mapping) or + if (not isinstance(constraint, collections.abc.Mapping) or len(constraint) != 1): ExceptionCollector.appendException( InvalidSchemaError(message=_('Invalid constraint schema.'))) @@ -390,7 +390,7 @@ class InRange(Constraint): def __init__(self, property_name, property_type, constraint): super(InRange, self).__init__(property_name, property_type, constraint) - if(not isinstance(self.constraint_value, collections.abc.Sequence) or + if (not isinstance(self.constraint_value, collections.abc.Sequence) or (len(constraint[self.IN_RANGE]) != 2)): ExceptionCollector.appendException( InvalidSchemaError(message=_('The property "in_range" ' @@ -403,7 +403,7 @@ def __init__(self, property_name, property_type, constraint): InvalidSchemaError(message=msg)) # The only string we allow for range is the special value # 'UNBOUNDED' - if(isinstance(value, str) and value != self.UNBOUNDED): + if (isinstance(value, str) and value != self.UNBOUNDED): ExceptionCollector.appendException( InvalidSchemaError(message=msg)) diff --git a/toscaparser/functions.py b/toscaparser/functions.py index 4d1ba4b5..ee603b37 100644 --- a/toscaparser/functions.py +++ b/toscaparser/functions.py @@ -709,9 +709,9 @@ def validate(self): def _find_operation_name(self, interface_name, operation_name, interfaces=None): - if(interface_name == 'Configure' or + if (interface_name == 'Configure' or interface_name == 'tosca.interfaces.node.relationship.Configure'): - if(operation_name in + if (operation_name in StatefulEntityType. interfaces_relationship_configure_operations): return operation_name @@ -720,9 +720,9 @@ def _find_operation_name(self, interface_name, operation_name, ValueError(_('Enter an operation of Configure interface' ).format(GET_OPERATION_OUTPUT))) return - elif(interface_name == 'Standard' or - interface_name == 'tosca.interfaces.node.lifecycle.Standard'): - if(operation_name in + elif (interface_name == 'Standard' or + interface_name == 'tosca.interfaces.node.lifecycle.Standard'): + if (operation_name in StatefulEntityType.interfaces_node_lifecycle_operations): return operation_name else: diff --git a/toscaparser/substitution_mappings.py b/toscaparser/substitution_mappings.py index 1e1d56a2..76f37049 100644 --- a/toscaparser/substitution_mappings.py +++ b/toscaparser/substitution_mappings.py @@ -299,7 +299,7 @@ def _validate_substitution_filter(self): UnknownFieldError(what=_('SubstitutionMappings'), field=key)) if 'properties' in value.keys(): - if type(tpls_filter[key]['properties']) != list: + if not isinstance(tpls_filter[key]['properties'], list): ExceptionCollector.appendException( TypeMismatchError( what=_( @@ -307,7 +307,7 @@ def _validate_substitution_filter(self): 'definition Keyname'), type='list')) if 'capabilities' in value.keys(): - if type(tpls_filter[key]['capabilities']) != list: + if not isinstance(tpls_filter[key]['capabilities'], list): ExceptionCollector.appendException( TypeMismatchError( what=_( From c7e327589c86a491e8bd1a4010caf4f7b7251bc2 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Fri, 7 Mar 2025 14:36:23 +0000 Subject: [PATCH 2/2] Update .gitreview for stable/2025.1 Change-Id: I5794e9b6ffab58c8939116082045bd4bfbffe0cd Depends-On: I68989196a962469b4f74e5120431fc18804ea465 --- .gitreview | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitreview b/.gitreview index d171fc8a..06943fa8 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.opendev.org port=29418 project=openstack/tosca-parser.git +defaultbranch=stable/2025.1