* [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error @ 2021-10-18 19:58 Arnout Vandecappelle (Essensium/Mind) 2021-10-18 19:58 ` [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name Arnout Vandecappelle (Essensium/Mind) ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Arnout Vandecappelle (Essensium/Mind) @ 2021-10-18 19:58 UTC (permalink / raw) To: buildroot The dbus-next package uses the Python type annotation for dbus types. This is not compatible with the python typing assumption that flake8 makes. Exclude F821 from this line. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/1687009829 partially: support/testing/tests/package/sample_python_dbus_next.py:17:36: F821 undefined name 's' support/testing/tests/package/sample_python_dbus_next.py:17:48: F821 undefined name 's' support/testing/tests/package/sample_python_dbus_next.py:17:56: F821 undefined name 's' Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- support/testing/tests/package/sample_python_dbus_next.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/testing/tests/package/sample_python_dbus_next.py b/support/testing/tests/package/sample_python_dbus_next.py index 1fcb76f45a..710bfa8c04 100644 --- a/support/testing/tests/package/sample_python_dbus_next.py +++ b/support/testing/tests/package/sample_python_dbus_next.py @@ -14,7 +14,7 @@ class SampleInterface(ServiceInterface): pass @method() - def ConcatStrings(self, what1: 's', what2: 's') -> 's': + def ConcatStrings(self, what1: 's', what2: 's') -> 's': # noqa: F821 return what1 + what2 -- 2.31.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name 2021-10-18 19:58 [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error Arnout Vandecappelle (Essensium/Mind) @ 2021-10-18 19:58 ` Arnout Vandecappelle (Essensium/Mind) 2021-10-18 20:34 ` Yann E. MORIN 2021-10-25 12:12 ` Peter Korsgaard 2021-10-18 20:33 ` [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error Yann E. MORIN 2021-10-25 12:10 ` Peter Korsgaard 2 siblings, 2 replies; 6+ messages in thread From: Arnout Vandecappelle (Essensium/Mind) @ 2021-10-18 19:58 UTC (permalink / raw) To: buildroot A recent update of flake8 in CI introduced a new check E741. It basically checks that variables are at least 3 characters long. Up to now, however, we have used shorter names in some places - all of them turn out to be "l" for a line of text. Replace all those "l" variables with "line". Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/1687009829 partially: support/scripts/boot-qemu-image.py:47:21: E741 ambiguous variable name 'l' support/scripts/check-dotconfig.py:20:38: E741 ambiguous variable name 'l' support/scripts/size-stats:76:13: E741 ambiguous variable name 'l' support/testing/tests/core/test_bad_arch.py:17:32: E741 ambiguous variable name 'l' support/testing/tests/package/test_python_treq.py:10:30: E741 ambiguous variable name 'l' support/testing/tests/toolchain/test_external.py:30:42: E741 ambiguous variable name 'l' Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- support/scripts/boot-qemu-image.py | 6 +++--- support/scripts/check-dotconfig.py | 2 +- support/scripts/size-stats | 4 ++-- support/testing/tests/core/test_bad_arch.py | 2 +- support/testing/tests/package/test_python_treq.py | 2 +- support/testing/tests/toolchain/test_external.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/support/scripts/boot-qemu-image.py b/support/scripts/boot-qemu-image.py index 0d4ad825fc..fba1533bb7 100755 --- a/support/scripts/boot-qemu-image.py +++ b/support/scripts/boot-qemu-image.py @@ -43,9 +43,9 @@ def main(): # In this case, spawn above will succeed at starting the wrapper # start-qemu.sh, but that one will fail (exit with 127) in such # a situation. - exit = [int(l.split(' ')[1]) - for l in e.value.splitlines() - if l.startswith('exitstatus: ')] + exit = [int(line.split(' ')[1]) + for line in e.value.splitlines() + if line.startswith('exitstatus: ')] if len(exit) and exit[0] == 127: print('qemu-start.sh could not find the qemu binary') sys.exit(0) diff --git a/support/scripts/check-dotconfig.py b/support/scripts/check-dotconfig.py index f9a416b743..54fd6ae91e 100755 --- a/support/scripts/check-dotconfig.py +++ b/support/scripts/check-dotconfig.py @@ -17,7 +17,7 @@ def main(): # strip() to get rid of trailing \n with open(configfile) as configf: - configlines = [l.strip() for l in configf.readlines()] + configlines = [line.strip() for line in configf.readlines()] defconfiglines = [] with open(defconfig) as defconfigf: diff --git a/support/scripts/size-stats b/support/scripts/size-stats index bf3d12a9b7..e4389e99b5 100755 --- a/support/scripts/size-stats +++ b/support/scripts/size-stats @@ -73,8 +73,8 @@ def add_file(filesdict, relpath, abspath, pkg): def build_package_dict(builddir): filesdict = {} with open(os.path.join(builddir, "build", "packages-file-list.txt")) as f: - for l in f.readlines(): - pkg, fpath = l.split(",", 1) + for line in f.readlines(): + pkg, fpath = line.split(",", 1) # remove the initial './' in each file path fpath = fpath.strip()[2:] fullpath = os.path.join(builddir, "target", fpath) diff --git a/support/testing/tests/core/test_bad_arch.py b/support/testing/tests/core/test_bad_arch.py index 316231e28e..c96a7152af 100644 --- a/support/testing/tests/core/test_bad_arch.py +++ b/support/testing/tests/core/test_bad_arch.py @@ -14,5 +14,5 @@ class DetectBadArchTest(infra.basetest.BRConfigTest): if logf_path: s = 'ERROR: architecture for "/usr/bin/foo" is' with open(logf_path, "r") as f: - lines = [l for l in f.readlines() if l.startswith(s)] + lines = [line for line in f.readlines() if line.startswith(s)] self.assertEqual(len(lines), 1) diff --git a/support/testing/tests/package/test_python_treq.py b/support/testing/tests/package/test_python_treq.py index d7a23829ea..307c9932b2 100644 --- a/support/testing/tests/package/test_python_treq.py +++ b/support/testing/tests/package/test_python_treq.py @@ -7,7 +7,7 @@ class TestPythonTreq(TestPythonPackageBase): def run_sample_scripts(self): cmd = self.interpreter + " sample_python_treq.py" output, exit_code = self.emulator.run(cmd, timeout=20) - refuse_msgs = [1 for l in output if "Connection refused" in l] + refuse_msgs = [1 for line in output if "Connection refused" in line] self.assertGreater(sum(refuse_msgs), 0) self.assertEqual(exit_code, 0) diff --git a/support/testing/tests/toolchain/test_external.py b/support/testing/tests/toolchain/test_external.py index db62a84391..d22f38cedc 100644 --- a/support/testing/tests/toolchain/test_external.py +++ b/support/testing/tests/toolchain/test_external.py @@ -27,7 +27,7 @@ class TestExternalToolchain(infra.basetest.BRTest): self.assertFalse(has_broken_links(path)) with open(os.path.join(self.builddir, ".config"), 'r') as configf: - configlines = [l.strip() for l in configf.readlines()] + configlines = [line.strip() for line in configf.readlines()] if "BR2_BINFMT_ELF=y" in configlines: interp = infra.get_elf_prog_interpreter(self.builddir, -- 2.31.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name 2021-10-18 19:58 ` [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name Arnout Vandecappelle (Essensium/Mind) @ 2021-10-18 20:34 ` Yann E. MORIN 2021-10-25 12:12 ` Peter Korsgaard 1 sibling, 0 replies; 6+ messages in thread From: Yann E. MORIN @ 2021-10-18 20:34 UTC (permalink / raw) To: Arnout Vandecappelle (Essensium/Mind); +Cc: buildroot Arnout, All, On 2021-10-18 21:58 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly: > A recent update of flake8 in CI introduced a new check E741. It > basically checks that variables are at least 3 characters long. Up to > now, however, we have used shorter names in some places - all of them > turn out to be "l" for a line of text. > > Replace all those "l" variables with "line". > > Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/1687009829 > partially: > support/scripts/boot-qemu-image.py:47:21: E741 ambiguous variable name 'l' > support/scripts/check-dotconfig.py:20:38: E741 ambiguous variable name 'l' > support/scripts/size-stats:76:13: E741 ambiguous variable name 'l' > support/testing/tests/core/test_bad_arch.py:17:32: E741 ambiguous variable name 'l' > support/testing/tests/package/test_python_treq.py:10:30: E741 ambiguous variable name 'l' > support/testing/tests/toolchain/test_external.py:30:42: E741 ambiguous variable name 'l' > > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> It's not really treewide, as all the changes are located in support/, so I've tweaked the title accordingly, and applied to master, thanks. Regards, Yann E. MORIN. > --- > support/scripts/boot-qemu-image.py | 6 +++--- > support/scripts/check-dotconfig.py | 2 +- > support/scripts/size-stats | 4 ++-- > support/testing/tests/core/test_bad_arch.py | 2 +- > support/testing/tests/package/test_python_treq.py | 2 +- > support/testing/tests/toolchain/test_external.py | 2 +- > 6 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/support/scripts/boot-qemu-image.py b/support/scripts/boot-qemu-image.py > index 0d4ad825fc..fba1533bb7 100755 > --- a/support/scripts/boot-qemu-image.py > +++ b/support/scripts/boot-qemu-image.py > @@ -43,9 +43,9 @@ def main(): > # In this case, spawn above will succeed at starting the wrapper > # start-qemu.sh, but that one will fail (exit with 127) in such > # a situation. > - exit = [int(l.split(' ')[1]) > - for l in e.value.splitlines() > - if l.startswith('exitstatus: ')] > + exit = [int(line.split(' ')[1]) > + for line in e.value.splitlines() > + if line.startswith('exitstatus: ')] > if len(exit) and exit[0] == 127: > print('qemu-start.sh could not find the qemu binary') > sys.exit(0) > diff --git a/support/scripts/check-dotconfig.py b/support/scripts/check-dotconfig.py > index f9a416b743..54fd6ae91e 100755 > --- a/support/scripts/check-dotconfig.py > +++ b/support/scripts/check-dotconfig.py > @@ -17,7 +17,7 @@ def main(): > > # strip() to get rid of trailing \n > with open(configfile) as configf: > - configlines = [l.strip() for l in configf.readlines()] > + configlines = [line.strip() for line in configf.readlines()] > > defconfiglines = [] > with open(defconfig) as defconfigf: > diff --git a/support/scripts/size-stats b/support/scripts/size-stats > index bf3d12a9b7..e4389e99b5 100755 > --- a/support/scripts/size-stats > +++ b/support/scripts/size-stats > @@ -73,8 +73,8 @@ def add_file(filesdict, relpath, abspath, pkg): > def build_package_dict(builddir): > filesdict = {} > with open(os.path.join(builddir, "build", "packages-file-list.txt")) as f: > - for l in f.readlines(): > - pkg, fpath = l.split(",", 1) > + for line in f.readlines(): > + pkg, fpath = line.split(",", 1) > # remove the initial './' in each file path > fpath = fpath.strip()[2:] > fullpath = os.path.join(builddir, "target", fpath) > diff --git a/support/testing/tests/core/test_bad_arch.py b/support/testing/tests/core/test_bad_arch.py > index 316231e28e..c96a7152af 100644 > --- a/support/testing/tests/core/test_bad_arch.py > +++ b/support/testing/tests/core/test_bad_arch.py > @@ -14,5 +14,5 @@ class DetectBadArchTest(infra.basetest.BRConfigTest): > if logf_path: > s = 'ERROR: architecture for "/usr/bin/foo" is' > with open(logf_path, "r") as f: > - lines = [l for l in f.readlines() if l.startswith(s)] > + lines = [line for line in f.readlines() if line.startswith(s)] > self.assertEqual(len(lines), 1) > diff --git a/support/testing/tests/package/test_python_treq.py b/support/testing/tests/package/test_python_treq.py > index d7a23829ea..307c9932b2 100644 > --- a/support/testing/tests/package/test_python_treq.py > +++ b/support/testing/tests/package/test_python_treq.py > @@ -7,7 +7,7 @@ class TestPythonTreq(TestPythonPackageBase): > def run_sample_scripts(self): > cmd = self.interpreter + " sample_python_treq.py" > output, exit_code = self.emulator.run(cmd, timeout=20) > - refuse_msgs = [1 for l in output if "Connection refused" in l] > + refuse_msgs = [1 for line in output if "Connection refused" in line] > self.assertGreater(sum(refuse_msgs), 0) > self.assertEqual(exit_code, 0) > > diff --git a/support/testing/tests/toolchain/test_external.py b/support/testing/tests/toolchain/test_external.py > index db62a84391..d22f38cedc 100644 > --- a/support/testing/tests/toolchain/test_external.py > +++ b/support/testing/tests/toolchain/test_external.py > @@ -27,7 +27,7 @@ class TestExternalToolchain(infra.basetest.BRTest): > self.assertFalse(has_broken_links(path)) > > with open(os.path.join(self.builddir, ".config"), 'r') as configf: > - configlines = [l.strip() for l in configf.readlines()] > + configlines = [line.strip() for line in configf.readlines()] > > if "BR2_BINFMT_ELF=y" in configlines: > interp = infra.get_elf_prog_interpreter(self.builddir, > -- > 2.31.1 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name 2021-10-18 19:58 ` [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name Arnout Vandecappelle (Essensium/Mind) 2021-10-18 20:34 ` Yann E. MORIN @ 2021-10-25 12:12 ` Peter Korsgaard 1 sibling, 0 replies; 6+ messages in thread From: Peter Korsgaard @ 2021-10-25 12:12 UTC (permalink / raw) To: Arnout Vandecappelle (Essensium/Mind); +Cc: buildroot >>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes: > A recent update of flake8 in CI introduced a new check E741. It > basically checks that variables are at least 3 characters long. Up to > now, however, we have used shorter names in some places - all of them > turn out to be "l" for a line of text. > Replace all those "l" variables with "line". > Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/1687009829 NIT: This is not about requiring >= 3 char variables, it is specifically about the variables I, O and l as they may look very similar to the numbers 0/1, depending on the font: https://www.flake8rules.com/rules/E741.html -- Bye, Peter Korsgaard _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error 2021-10-18 19:58 [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error Arnout Vandecappelle (Essensium/Mind) 2021-10-18 19:58 ` [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name Arnout Vandecappelle (Essensium/Mind) @ 2021-10-18 20:33 ` Yann E. MORIN 2021-10-25 12:10 ` Peter Korsgaard 2 siblings, 0 replies; 6+ messages in thread From: Yann E. MORIN @ 2021-10-18 20:33 UTC (permalink / raw) To: Arnout Vandecappelle (Essensium/Mind); +Cc: buildroot Arnout, All, On 2021-10-18 21:58 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly: > The dbus-next package uses the Python type annotation for dbus types. This is > not compatible with the python typing assumption that flake8 makes. > > Exclude F821 from this line. > > Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/1687009829 > partially: > support/testing/tests/package/sample_python_dbus_next.py:17:36: F821 undefined name 's' > support/testing/tests/package/sample_python_dbus_next.py:17:48: F821 undefined name 's' > support/testing/tests/package/sample_python_dbus_next.py:17:56: F821 undefined name 's' > > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> You beat me to it, but I still managed to put my little touch: I've changed the title to: support/testing: ... Applied to master, thanks. Regards, Yann E. MORIN. > --- > support/testing/tests/package/sample_python_dbus_next.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/support/testing/tests/package/sample_python_dbus_next.py b/support/testing/tests/package/sample_python_dbus_next.py > index 1fcb76f45a..710bfa8c04 100644 > --- a/support/testing/tests/package/sample_python_dbus_next.py > +++ b/support/testing/tests/package/sample_python_dbus_next.py > @@ -14,7 +14,7 @@ class SampleInterface(ServiceInterface): > pass > > @method() > - def ConcatStrings(self, what1: 's', what2: 's') -> 's': > + def ConcatStrings(self, what1: 's', what2: 's') -> 's': # noqa: F821 > return what1 + what2 > > > -- > 2.31.1 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error 2021-10-18 19:58 [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error Arnout Vandecappelle (Essensium/Mind) 2021-10-18 19:58 ` [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name Arnout Vandecappelle (Essensium/Mind) 2021-10-18 20:33 ` [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error Yann E. MORIN @ 2021-10-25 12:10 ` Peter Korsgaard 2 siblings, 0 replies; 6+ messages in thread From: Peter Korsgaard @ 2021-10-25 12:10 UTC (permalink / raw) To: Arnout Vandecappelle (Essensium/Mind); +Cc: buildroot >>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes: > The dbus-next package uses the Python type annotation for dbus types. This is > not compatible with the python typing assumption that flake8 makes. > Exclude F821 from this line. > Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/1687009829 > partially: > support/testing/tests/package/sample_python_dbus_next.py:17:36: F821 undefined name 's' > support/testing/tests/package/sample_python_dbus_next.py:17:48: F821 undefined name 's' > support/testing/tests/package/sample_python_dbus_next.py:17:56: F821 undefined name 's' Committed to 2021.08.x, thanks. -- Bye, Peter Korsgaard _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-10-25 12:12 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-10-18 19:58 [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error Arnout Vandecappelle (Essensium/Mind) 2021-10-18 19:58 ` [Buildroot] [PATCH 2/2] treewide: fix flake8 error E741 ambiguous variable name Arnout Vandecappelle (Essensium/Mind) 2021-10-18 20:34 ` Yann E. MORIN 2021-10-25 12:12 ` Peter Korsgaard 2021-10-18 20:33 ` [Buildroot] [PATCH 1/2] tests: sample_python_dbus_next: ignore F821 flake8 error Yann E. MORIN 2021-10-25 12:10 ` Peter Korsgaard
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.