Re: [ovs-dev] [PATCH] python: Fix E275 missing whitespace after keyword.
On 8/4/22 17:56, Dumitru Ceara wrote: > On 8/4/22 17:51, Ilya Maximets wrote: >> On 8/4/22 17:47, Dumitru Ceara wrote: >>> On 8/4/22 16:33, Mike Pattrick wrote: On Thu, Aug 4, 2022 at 9:56 AM Ilya Maximets wrote: > > With just released flake8 5.0 we're getting a bunch of E275 errors: > > utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after > keyword > tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword > python/setup.py:105:8: E275 missing whitespace after keyword > python/setup.py:106:8: E275 missing whitespace after keyword > make[2]: *** [flake8-check] Error 1 > > This breaks CI on branches below 2.16. We don't see a problem right > now on newer branches because we're installing extra dependencies > that backtrack flake8 down to 4.1 or even 3.9. > > Signed-off-by: Ilya Maximets Looks good to me! Acked-by: Mike Pattrick >>> >>> I'm still getting: >>> >>> python/ovs/db/idl.py:145:15: E275 missing whitespace after keyword >>> python/ovs/db/idl.py:167:15: E275 missing whitespace after keyword >>> >>> Because of "assert" being a keyword too. >> >> OK. I only fixed ones that failed CI on branch-2.15 and below >> and this code is fairly new. >> >> I can fold the following in while applying the change, If that's OK: >> >> diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py >> index b87099ff5..8f13d1f55 100644 >> --- a/python/ovs/db/idl.py >> +++ b/python/ovs/db/idl.py >> @@ -142,7 +142,7 @@ class ConditionState(object): >> >> class IdlTable(object): >> def __init__(self, idl, table): >> -assert(isinstance(table, ovs.db.schema.TableSchema)) >> +assert isinstance(table, ovs.db.schema.TableSchema) >> self._table = table >> self.need_table = False >> self.rows = custom_index.IndexedRows(self) >> @@ -164,7 +164,7 @@ class IdlTable(object): >> >> @condition.setter >> def condition(self, condition): >> -assert(isinstance(condition, list)) >> +assert isinstance(condition, list) >> self.idl.cond_change(self.name, condition) >> >> @classmethod >> --- >> >> What do you think? > > Looks good to me, thanks! > > Acked-by: Dumitru Ceara > Thanks! Applied to all supported branches down to 2.13. Best regards, Ilya Maximets. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] python: Fix E275 missing whitespace after keyword.
On 8/4/22 17:51, Ilya Maximets wrote: > On 8/4/22 17:47, Dumitru Ceara wrote: >> On 8/4/22 16:33, Mike Pattrick wrote: >>> On Thu, Aug 4, 2022 at 9:56 AM Ilya Maximets wrote: With just released flake8 5.0 we're getting a bunch of E275 errors: utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after keyword tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword python/setup.py:105:8: E275 missing whitespace after keyword python/setup.py:106:8: E275 missing whitespace after keyword make[2]: *** [flake8-check] Error 1 This breaks CI on branches below 2.16. We don't see a problem right now on newer branches because we're installing extra dependencies that backtrack flake8 down to 4.1 or even 3.9. Signed-off-by: Ilya Maximets >>> >>> Looks good to me! >>> >>> Acked-by: Mike Pattrick >>> >> >> I'm still getting: >> >> python/ovs/db/idl.py:145:15: E275 missing whitespace after keyword >> python/ovs/db/idl.py:167:15: E275 missing whitespace after keyword >> >> Because of "assert" being a keyword too. > > OK. I only fixed ones that failed CI on branch-2.15 and below > and this code is fairly new. > > I can fold the following in while applying the change, If that's OK: > > diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py > index b87099ff5..8f13d1f55 100644 > --- a/python/ovs/db/idl.py > +++ b/python/ovs/db/idl.py > @@ -142,7 +142,7 @@ class ConditionState(object): > > class IdlTable(object): > def __init__(self, idl, table): > -assert(isinstance(table, ovs.db.schema.TableSchema)) > +assert isinstance(table, ovs.db.schema.TableSchema) > self._table = table > self.need_table = False > self.rows = custom_index.IndexedRows(self) > @@ -164,7 +164,7 @@ class IdlTable(object): > > @condition.setter > def condition(self, condition): > -assert(isinstance(condition, list)) > +assert isinstance(condition, list) > self.idl.cond_change(self.name, condition) > > @classmethod > --- > > What do you think? Looks good to me, thanks! Acked-by: Dumitru Ceara ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] python: Fix E275 missing whitespace after keyword.
On 8/4/22 17:47, Dumitru Ceara wrote: > On 8/4/22 16:33, Mike Pattrick wrote: >> On Thu, Aug 4, 2022 at 9:56 AM Ilya Maximets wrote: >>> >>> With just released flake8 5.0 we're getting a bunch of E275 errors: >>> >>> utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after >>> keyword >>> tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword >>> python/setup.py:105:8: E275 missing whitespace after keyword >>> python/setup.py:106:8: E275 missing whitespace after keyword >>> make[2]: *** [flake8-check] Error 1 >>> >>> This breaks CI on branches below 2.16. We don't see a problem right >>> now on newer branches because we're installing extra dependencies >>> that backtrack flake8 down to 4.1 or even 3.9. >>> >>> Signed-off-by: Ilya Maximets >> >> Looks good to me! >> >> Acked-by: Mike Pattrick >> > > I'm still getting: > > python/ovs/db/idl.py:145:15: E275 missing whitespace after keyword > python/ovs/db/idl.py:167:15: E275 missing whitespace after keyword > > Because of "assert" being a keyword too. OK. I only fixed ones that failed CI on branch-2.15 and below and this code is fairly new. I can fold the following in while applying the change, If that's OK: diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index b87099ff5..8f13d1f55 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -142,7 +142,7 @@ class ConditionState(object): class IdlTable(object): def __init__(self, idl, table): -assert(isinstance(table, ovs.db.schema.TableSchema)) +assert isinstance(table, ovs.db.schema.TableSchema) self._table = table self.need_table = False self.rows = custom_index.IndexedRows(self) @@ -164,7 +164,7 @@ class IdlTable(object): @condition.setter def condition(self, condition): -assert(isinstance(condition, list)) +assert isinstance(condition, list) self.idl.cond_change(self.name, condition) @classmethod --- What do you think? Best regards, Ilya Maximets. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] python: Fix E275 missing whitespace after keyword.
On 8/4/22 16:33, Mike Pattrick wrote: > On Thu, Aug 4, 2022 at 9:56 AM Ilya Maximets wrote: >> >> With just released flake8 5.0 we're getting a bunch of E275 errors: >> >> utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after >> keyword >> tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword >> python/setup.py:105:8: E275 missing whitespace after keyword >> python/setup.py:106:8: E275 missing whitespace after keyword >> make[2]: *** [flake8-check] Error 1 >> >> This breaks CI on branches below 2.16. We don't see a problem right >> now on newer branches because we're installing extra dependencies >> that backtrack flake8 down to 4.1 or even 3.9. >> >> Signed-off-by: Ilya Maximets > > Looks good to me! > > Acked-by: Mike Pattrick > I'm still getting: python/ovs/db/idl.py:145:15: E275 missing whitespace after keyword python/ovs/db/idl.py:167:15: E275 missing whitespace after keyword Because of "assert" being a keyword too. I'm running: $ flake8 --version 5.0.3 (mccabe: 0.7.0, pycodestyle: 2.9.0, pyflakes: 2.5.0) CPython 3.6.8 on Linux Regards, Dumitru >> --- >> python/setup.py | 4 ++-- >> tests/test-ovsdb.py | 2 +- >> utilities/bugtool/ovs-bugtool.in | 2 +- >> 3 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/python/setup.py b/python/setup.py >> index 062901ddd..27684c404 100644 >> --- a/python/setup.py >> +++ b/python/setup.py >> @@ -124,6 +124,6 @@ except BuildFailed: >> print("Retrying the build without the C extension.") >> print("*" * 75) >> >> -del(setup_args['cmdclass']) >> -del(setup_args['ext_modules']) >> +del setup_args['cmdclass'] >> +del setup_args['ext_modules'] >> setuptools.setup(**setup_args) >> diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py >> index 853264f22..402cacbe9 100644 >> --- a/tests/test-ovsdb.py >> +++ b/tests/test-ovsdb.py >> @@ -620,7 +620,7 @@ def update_condition(idl, commands): >> commands = commands[len("condition "):].split(";") >> for command in commands: >> command = command.split(" ") >> -if(len(command) != 2): >> +if len(command) != 2: >> sys.stderr.write("Error parsing condition %s\n" % command) >> sys.exit(1) >> >> diff --git a/utilities/bugtool/ovs-bugtool.in >> b/utilities/bugtool/ovs-bugtool.in >> index fa62cbe94..fee0de853 100755 >> --- a/utilities/bugtool/ovs-bugtool.in >> +++ b/utilities/bugtool/ovs-bugtool.in >> @@ -956,7 +956,7 @@ def load_plugins(just_capabilities=False, filter=None): >> filters = [] >> else: >> filters = filters_tmp.split(',') >> -if not(filter is None or filter in filters): >> +if not (filter is None or filter in filters): >> continue >> if el.tagName == "files": >> newest_first = getBoolAttr(el, 'newest_first') >> -- >> 2.34.3 >> >> ___ >> dev mailing list >> d...@openvswitch.org >> https://mail.openvswitch.org/mailman/listinfo/ovs-dev >> > > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] python: Fix E275 missing whitespace after keyword.
On Thu, Aug 4, 2022 at 9:56 AM Ilya Maximets wrote: > > With just released flake8 5.0 we're getting a bunch of E275 errors: > > utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after > keyword > tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword > python/setup.py:105:8: E275 missing whitespace after keyword > python/setup.py:106:8: E275 missing whitespace after keyword > make[2]: *** [flake8-check] Error 1 > > This breaks CI on branches below 2.16. We don't see a problem right > now on newer branches because we're installing extra dependencies > that backtrack flake8 down to 4.1 or even 3.9. > > Signed-off-by: Ilya Maximets Looks good to me! Acked-by: Mike Pattrick > --- > python/setup.py | 4 ++-- > tests/test-ovsdb.py | 2 +- > utilities/bugtool/ovs-bugtool.in | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/python/setup.py b/python/setup.py > index 062901ddd..27684c404 100644 > --- a/python/setup.py > +++ b/python/setup.py > @@ -124,6 +124,6 @@ except BuildFailed: > print("Retrying the build without the C extension.") > print("*" * 75) > > -del(setup_args['cmdclass']) > -del(setup_args['ext_modules']) > +del setup_args['cmdclass'] > +del setup_args['ext_modules'] > setuptools.setup(**setup_args) > diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py > index 853264f22..402cacbe9 100644 > --- a/tests/test-ovsdb.py > +++ b/tests/test-ovsdb.py > @@ -620,7 +620,7 @@ def update_condition(idl, commands): > commands = commands[len("condition "):].split(";") > for command in commands: > command = command.split(" ") > -if(len(command) != 2): > +if len(command) != 2: > sys.stderr.write("Error parsing condition %s\n" % command) > sys.exit(1) > > diff --git a/utilities/bugtool/ovs-bugtool.in > b/utilities/bugtool/ovs-bugtool.in > index fa62cbe94..fee0de853 100755 > --- a/utilities/bugtool/ovs-bugtool.in > +++ b/utilities/bugtool/ovs-bugtool.in > @@ -956,7 +956,7 @@ def load_plugins(just_capabilities=False, filter=None): > filters = [] > else: > filters = filters_tmp.split(',') > -if not(filter is None or filter in filters): > +if not (filter is None or filter in filters): > continue > if el.tagName == "files": > newest_first = getBoolAttr(el, 'newest_first') > -- > 2.34.3 > > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH] python: Fix E275 missing whitespace after keyword.
With just released flake8 5.0 we're getting a bunch of E275 errors: utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after keyword tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword python/setup.py:105:8: E275 missing whitespace after keyword python/setup.py:106:8: E275 missing whitespace after keyword make[2]: *** [flake8-check] Error 1 This breaks CI on branches below 2.16. We don't see a problem right now on newer branches because we're installing extra dependencies that backtrack flake8 down to 4.1 or even 3.9. Signed-off-by: Ilya Maximets --- python/setup.py | 4 ++-- tests/test-ovsdb.py | 2 +- utilities/bugtool/ovs-bugtool.in | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/setup.py b/python/setup.py index 062901ddd..27684c404 100644 --- a/python/setup.py +++ b/python/setup.py @@ -124,6 +124,6 @@ except BuildFailed: print("Retrying the build without the C extension.") print("*" * 75) -del(setup_args['cmdclass']) -del(setup_args['ext_modules']) +del setup_args['cmdclass'] +del setup_args['ext_modules'] setuptools.setup(**setup_args) diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py index 853264f22..402cacbe9 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -620,7 +620,7 @@ def update_condition(idl, commands): commands = commands[len("condition "):].split(";") for command in commands: command = command.split(" ") -if(len(command) != 2): +if len(command) != 2: sys.stderr.write("Error parsing condition %s\n" % command) sys.exit(1) diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in index fa62cbe94..fee0de853 100755 --- a/utilities/bugtool/ovs-bugtool.in +++ b/utilities/bugtool/ovs-bugtool.in @@ -956,7 +956,7 @@ def load_plugins(just_capabilities=False, filter=None): filters = [] else: filters = filters_tmp.split(',') -if not(filter is None or filter in filters): +if not (filter is None or filter in filters): continue if el.tagName == "files": newest_first = getBoolAttr(el, 'newest_first') -- 2.34.3 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev