* BitBake Linting Errors
@ 2026-03-26 18:57 Rob Woolley
2026-03-26 18:57 ` [PATCH 01/11] bitbake-setup: Remove extraneous variable from str.format() Rob Woolley
` (10 more replies)
0 siblings, 11 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
Using the ruff tool on bitbake-setup reports a number of linting errors.
This patch series resolves those errors to give bitbake-setup a clean bill
of health:
bitbake-setup: Remove extraneous variable from
bitbake-setup: Resolve unused loop control variables
bitbake-setup: Fix ambiguous variable names
bitbake-setup: Remove unused stdout variable
bitbake-setup: Replace f-string without placeholders
bitbake-setup: Remove unused Namespace import
bitbake-setup: Remove unused parser_settings_list
bitbake-setup: Fix linting error related to membership
bitbake-setup: Maintain exception chain
bitbake-setup: Set function default to None
bitbake-setup: Sort and format imports
bitbake-setup: Remove extraneous variable from
bitbake-setup: Resolve unused loop control variables
bitbake-setup: Fix ambiguous variable names
bitbake-setup: Remove unused stdout variable
bitbake-setup: Replace f-string without placeholders
bitbake-setup: Remove unused Namespace import
bitbake-setup: Remove unused parser_settings_list
bitbake-setup: Fix linting error related to membership
bitbake-setup: Maintain exception chain
bitbake-setup: Set function default to None
bitbake-setup: Sort and format imports
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 01/11] bitbake-setup: Remove extraneous variable from str.format()
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 02/11] bitbake-setup: Resolve unused loop control variables Rob Woolley
` (9 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The invocation of str.format() supplied an extra parameter that
was not being referenced in the string.
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index dcad9c169..212da4f88 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -1176,7 +1176,7 @@ def main():
list_configs(all_settings, args)
return
- logger.info('Bitbake-setup is using {} as top directory.'.format(top_dir, global_settings_path(args)))
+ logger.info('Bitbake-setup is using {} as top directory.'.format(top_dir))
if args.func == init_config:
init_config(top_dir, all_settings, args)
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 02/11] bitbake-setup: Resolve unused loop control variables
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
2026-03-26 18:57 ` [PATCH 01/11] bitbake-setup: Remove extraneous variable from str.format() Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 03/11] bitbake-setup: Fix ambiguous variable names Rob Woolley
` (8 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The ruff lint tool reported loop control variables that were
not being used:
B007 Loop control variable `dirs` not used within loop body
Adding underscore as a prefix helps indicate that it is not
being used inside the loop.
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 212da4f88..60d324b39 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -133,7 +133,7 @@ def commit_config(config_dir):
def _write_layer_list(dest, repodirs):
layers = []
for r in repodirs:
- for root, dirs, files in os.walk(os.path.join(dest,r)):
+ for root, _dirs, files in os.walk(os.path.join(dest,r)):
if os.path.basename(root) == 'conf' and 'layer.conf' in files:
layers.append(os.path.relpath(os.path.dirname(root), dest))
layers_f = os.path.join(dest, ".oe-layers.json")
@@ -414,7 +414,7 @@ The bitbake configuration files (local.conf, bblayers.conf and more) can be foun
logger.plain("The bitbake configuration files (local.conf, bblayers.conf and more) can be found in\n {}/conf\n".format(bitbake_builddir))
def get_registry_config(registry_path, id):
- for root, dirs, files in os.walk(registry_path):
+ for root, _dirs, files in os.walk(registry_path):
for f in files:
if f.endswith('.conf.json') and id == get_config_name(f):
return os.path.join(root, f)
@@ -818,7 +818,7 @@ def has_expired(expiry_date):
def list_registry(registry_path, with_expired):
json_data = {}
- for root, dirs, files in os.walk(registry_path):
+ for root, _dirs, files in os.walk(registry_path):
for f in files:
if f.endswith('.conf.json'):
config_name = get_config_name(f)
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 03/11] bitbake-setup: Fix ambiguous variable names
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
2026-03-26 18:57 ` [PATCH 01/11] bitbake-setup: Remove extraneous variable from str.format() Rob Woolley
2026-03-26 18:57 ` [PATCH 02/11] bitbake-setup: Resolve unused loop control variables Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 04/11] bitbake-setup: Remove unused stdout variable Rob Woolley
` (7 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The ruff lint tool detected use of ambiguous variables that
were named with a single letter:
E741 Ambiguous variable name: `l`
E741 Ambiguous variable name: `f`
This replaces the variables with a descriptive variable to add
clarity.
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 60d324b39..828459a00 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -231,11 +231,11 @@ bitbake-setup init -L {} /path/to/repo/checkout""".format(
if oesetupbuild:
links = {'setup-build': oesetupbuild, 'oe-scripts': os.path.dirname(oesetupbuild), 'oe-init-build-env-dir': oeinitbuildenvdir}
- for l,t in links.items():
- symlink = os.path.join(layerdir, l)
+ for link,item in links.items():
+ symlink = os.path.join(layerdir, link)
if os.path.lexists(symlink):
os.remove(symlink)
- os.symlink(os.path.relpath(t,layerdir),symlink)
+ os.symlink(os.path.relpath(item,layerdir),symlink)
return layers_fixed_revisions
@@ -244,19 +244,19 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir, update_bb_c
os.makedirs(build_conf_dir)
layers_s = []
- for l in layers:
- l = os.path.join(layerdir, l)
- layers_s.append(" {} \\".format(l))
+ for layer in layers:
+ layer = os.path.join(layerdir, layer)
+ layers_s.append(" {} \\".format(layer))
- for l in filerelative_layers:
+ for layer in filerelative_layers:
if thisdir:
- l = os.path.join(thisdir, l)
+ layer = os.path.join(thisdir, layer)
else:
raise Exception("Configuration is using bb-layers-file-relative to specify " \
"a layer path relative to itself. This can be done only " \
"when the configuration is specified by its path on local " \
"disk, not when it's in a registry or is fetched over http.")
- layers_s.append(" {} \\".format(l))
+ layers_s.append(" {} \\".format(layer))
layers_s = "\n".join(layers_s)
bblayers_conf = """BBLAYERS ?= " \\
@@ -415,9 +415,9 @@ The bitbake configuration files (local.conf, bblayers.conf and more) can be foun
def get_registry_config(registry_path, id):
for root, _dirs, files in os.walk(registry_path):
- for f in files:
- if f.endswith('.conf.json') and id == get_config_name(f):
- return os.path.join(root, f)
+ for file in files:
+ if file.endswith('.conf.json') and id == get_config_name(file):
+ return os.path.join(root, file)
raise Exception("Unable to find {} in available configurations; use 'list' sub-command to see what is available".format(id))
def merge_overrides_into_sources(sources, overrides):
@@ -819,10 +819,10 @@ def list_registry(registry_path, with_expired):
json_data = {}
for root, _dirs, files in os.walk(registry_path):
- for f in files:
- if f.endswith('.conf.json'):
- config_name = get_config_name(f)
- config_data = json.load(open(os.path.join(root, f)))
+ for file in files:
+ if file.endswith('.conf.json'):
+ config_name = get_config_name(file)
+ config_data = json.load(open(os.path.join(root, file)))
config_desc = config_data["description"]
expiry_date = config_data.get("expires", None)
if expiry_date:
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 04/11] bitbake-setup: Remove unused stdout variable
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (2 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 03/11] bitbake-setup: Fix ambiguous variable names Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 05/11] bitbake-setup: Replace f-string without placeholders Rob Woolley
` (6 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The ruff lint tool reported that stdout was never used:
F841 Local variable `stdout` is assigned to but never used
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 828459a00..47f02a46e 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -626,7 +626,7 @@ def init_config(top_dir, settings, args):
create_siteconf(top_dir, args.non_interactive, settings)
d = init_bb_cache(top_dir, settings, args)
- stdout = sys.stdout
+
def handle_task_progress(event, d):
rate = event.rate if event.rate else ''
progress = event.progress if event.progress > 0 else 0
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 05/11] bitbake-setup: Replace f-string without placeholders
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (3 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 04/11] bitbake-setup: Remove unused stdout variable Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 06/11] bitbake-setup: Remove unused Namespace import Rob Woolley
` (5 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The ruff lint tool reported an f-string that didn't include any
placeholders:
F541 f-string without any placeholders
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 47f02a46e..08d9a8d09 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -1040,7 +1040,7 @@ def merge_settings(builtin_settings, global_settings, topdir_settings, cmdline_s
return all_settings
def sigint_handler(sig, frame, func, top_dir):
- logger.plain(f'\nShutting down...')
+ logger.plain('\nShutting down...')
if isinstance(top_dir, str) and os.path.exists(top_dir):
if func in [init_config, build_update]:
logger.warning(f'{top_dir} may contain an incomplete setup!')
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 06/11] bitbake-setup: Remove unused Namespace import
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (4 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 05/11] bitbake-setup: Replace f-string without placeholders Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 07/11] bitbake-setup: Remove unused parser_settings_list Rob Woolley
` (4 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The ruff lint tool reported that Namespace was not used:
F401 `argparse.Namespace` imported but unused
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 1 -
1 file changed, 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 08d9a8d09..00be16438 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -1186,7 +1186,6 @@ def main():
save_bb_cache()
else:
- from argparse import Namespace
parser.print_help()
main()
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 07/11] bitbake-setup: Remove unused parser_settings_list
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (5 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 06/11] bitbake-setup: Remove unused Namespace import Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 08/11] bitbake-setup: Fix linting error related to membership Rob Woolley
` (3 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The ruff lint tool detected an used variable:
F841 Local variable `parser_settings_list` is assigned to but never used
The list_settings function gets invoked through the parent command's
settings_func function. This means that creating this variable is
unnecessary.
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 00be16438..7cc3f9253 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -1109,8 +1109,7 @@ def main():
subparser_settings = parser_settings.add_subparsers(dest="subcommand", required=True, help="The action to perform on the settings file")
- parser_settings_list = subparser_settings.add_parser('list',
- help="List all settings with their values")
+ subparser_settings.add_parser('list', help="List all settings with their values")
parser_settings_set = subparser_settings.add_parser('set', parents=[parser_settings_arg_global],
help="In a Section, set a setting to a certain value")
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 08/11] bitbake-setup: Fix linting error related to membership
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (6 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 07/11] bitbake-setup: Remove unused parser_settings_list Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 09/11] bitbake-setup: Maintain exception chain Rob Woolley
` (2 subsequent siblings)
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The pycodestyle E713 recommends that negative tests for membership
use `foo not in bar` instead of `not foo in bar`.
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 7cc3f9253..e2b2f1836 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -154,7 +154,7 @@ def add_unique_timestamp_to_path(path):
def _get_remotes(r_remote):
remotes = []
- if not 'remotes' in r_remote and not 'uri' in r_remote:
+ if 'remotes' not in r_remote and 'uri' not in r_remote:
raise Exception("Expected key(s): 'remotes', 'uri'")
if 'remotes' in r_remote:
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 09/11] bitbake-setup: Maintain exception chain
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (7 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 08/11] bitbake-setup: Fix linting error related to membership Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-26 18:57 ` [PATCH 10/11] bitbake-setup: Set function default to None Rob Woolley
2026-03-26 18:57 ` [PATCH 11/11] bitbake-setup: Sort and format imports Rob Woolley
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
Chain the exceptions so that it is easier to trace the exception
back to its root cause. This resolves B904 linting issues from
flake8-bugbear.
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index e2b2f1836..2e1e347d6 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -579,7 +579,7 @@ def obtain_config(top_dir, registry, args, source_overrides, d):
json_data = json.load(f)
upstream_config = {'type':'network','uri':config_id,'name':get_config_name(config_id),'data':json_data}
except json.JSONDecodeError as e:
- raise Exception ("Invalid JSON from {}. Are you pointing to an HTML page? {}".format(config_id, e))
+ raise Exception ("Invalid JSON from {}. Are you pointing to an HTML page? {}".format(config_id, e)) from e
else:
logger.info("Looking up config {} in configuration registry".format(config_id))
registry_path = update_registry(registry, cache_dir(top_dir), d)
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 10/11] bitbake-setup: Set function default to None
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (8 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 09/11] bitbake-setup: Maintain exception chain Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
2026-03-30 16:34 ` [bitbake-devel] " adrian.freihofer
2026-03-26 18:57 ` [PATCH 11/11] bitbake-setup: Sort and format imports Rob Woolley
10 siblings, 1 reply; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The function defaults are evaluated once and use across calls
can lead to unexpected behaviour.
Set the value to none and let the function initialize the value
in the case when the value is not set.
Resolves B006 from flake8-bugbear
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 2e1e347d6..6b210cd3e 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -45,7 +45,7 @@ def color_enabled() -> bool:
def get_diff_color_param() -> str:
return "--color=always" if color_enabled() else "--color=never"
-def print_configs(prompt: str, choices: list[str], descriptions: list[str] = []):
+def print_configs(prompt: str, choices: list[str], descriptions: list[str] = None):
"""
Helper function to print a list of choices and align the output.
Each option name is made bold to stand out, unless color is not enabled in
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 11/11] bitbake-setup: Sort and format imports
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
` (9 preceding siblings ...)
2026-03-26 18:57 ` [PATCH 10/11] bitbake-setup: Set function default to None Rob Woolley
@ 2026-03-26 18:57 ` Rob Woolley
10 siblings, 0 replies; 15+ messages in thread
From: Rob Woolley @ 2026-03-26 18:57 UTC (permalink / raw)
To: bitbake-devel; +Cc: alex.kanavin
The ruff linting tool reported 2 problems:
I001 Import block is un-sorted or un-formatted
E402 Module level import not at top of file
An exception is made for sys.path modifications needed to
find the modules.
Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
bin/bitbake-setup | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 6b210cd3e..ce712e517 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -4,28 +4,29 @@
# SPDX-License-Identifier: GPL-2.0-only
#
-import logging
-import os
-import sys
import argparse
-import json
-import shutil
-import time
import configparser
+import copy
import datetime
+import functools
import glob
-import subprocess
-import copy
-import textwrap
+import json
+import logging
+import os
+import shutil
import signal
-import functools
import string
+import subprocess
+import sys
+import textwrap
+import time
+
bindir = os.path.abspath(os.path.dirname(__file__))
sys.path[0:0] = [os.path.join(os.path.dirname(bindir), 'lib')]
-import bb.msg
-import bb.process
+import bb.msg # noqa: E402
+import bb.process # noqa: E402
logger = bb.msg.logger_create('bitbake-setup', sys.stdout)
--
2.39.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [bitbake-devel] [PATCH 10/11] bitbake-setup: Set function default to None
2026-03-26 18:57 ` [PATCH 10/11] bitbake-setup: Set function default to None Rob Woolley
@ 2026-03-30 16:34 ` adrian.freihofer
2026-03-30 21:49 ` Woolley, Rob
0 siblings, 1 reply; 15+ messages in thread
From: adrian.freihofer @ 2026-03-30 16:34 UTC (permalink / raw)
To: rob.woolley, bitbake-devel; +Cc: alex.kanavin
On Thu, 2026-03-26 at 11:57 -0700, Rob Woolley via
lists.openembedded.org wrote:
> The function defaults are evaluated once and use across calls
> can lead to unexpected behaviour.
>
> Set the value to none and let the function initialize the value
> in the case when the value is not set.
>
> Resolves B006 from flake8-bugbear
>
> Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
> ---
> bin/bitbake-setup | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bin/bitbake-setup b/bin/bitbake-setup
> index 2e1e347d6..6b210cd3e 100755
> --- a/bin/bitbake-setup
> +++ b/bin/bitbake-setup
> @@ -45,7 +45,7 @@ def color_enabled() -> bool:
> def get_diff_color_param() -> str:
> return "--color=always" if color_enabled() else "--color=never"
>
> -def print_configs(prompt: str, choices: list[str], descriptions:
> list[str] = []):
> +def print_configs(prompt: str, choices: list[str], descriptions:
> list[str] = None):
While "= None" looks better than "= []", this is still a bit wrong. It
should be:
list[str] | None = None
However, this syntax would require Python 3.10+, so not possible.
Other options could be:
- Dropping the type checks from this function
- Using typing.Optional ?
Regards,
Adrian
> """
> Helper function to print a list of choices and align the output.
> Each option name is made bold to stand out, unless color is not
> enabled in
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#19255):
> https://lists.openembedded.org/g/bitbake-devel/message/19255
> Mute This Topic: https://lists.openembedded.org/mt/118523930/4454582
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/bitbake-devel/unsub [adrian.freihofer@gmail.com
> ]
> -=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [bitbake-devel] [PATCH 10/11] bitbake-setup: Set function default to None
2026-03-30 16:34 ` [bitbake-devel] " adrian.freihofer
@ 2026-03-30 21:49 ` Woolley, Rob
2026-03-30 22:51 ` Richard Purdie
0 siblings, 1 reply; 15+ messages in thread
From: Woolley, Rob @ 2026-03-30 21:49 UTC (permalink / raw)
To: adrian.freihofer@gmail.com, bitbake-devel@lists.openembedded.org
Cc: alex.kanavin@gmail.com
[-- Attachment #1: Type: text/plain, Size: 2796 bytes --]
Thanks for pointing this out.
As far as Python 3.9 is concerned, it went end-of-life on October 31, 2025. I recognize that some supported hosts (like Debian 11 and RHEL 9) may have it by default. Do we increment the minimum Python version when the language runtime goes EOL or when the supported hosts do?
Regards,
Rob
________________________________
From: adrian.freihofer@gmail.com <adrian.freihofer@gmail.com>
Sent: Monday, March 30, 2026 12:34 PM
To: Woolley, Rob <Rob.Woolley@windriver.com>; bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org>
Cc: alex.kanavin@gmail.com <alex.kanavin@gmail.com>
Subject: Re: [bitbake-devel] [PATCH 10/11] bitbake-setup: Set function default to None
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.
On Thu, 2026-03-26 at 11:57 -0700, Rob Woolley via
lists.openembedded.org wrote:
> The function defaults are evaluated once and use across calls
> can lead to unexpected behaviour.
>
> Set the value to none and let the function initialize the value
> in the case when the value is not set.
>
> Resolves B006 from flake8-bugbear
>
> Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
> ---
> bin/bitbake-setup | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bin/bitbake-setup b/bin/bitbake-setup
> index 2e1e347d6..6b210cd3e 100755
> --- a/bin/bitbake-setup
> +++ b/bin/bitbake-setup
> @@ -45,7 +45,7 @@ def color_enabled() -> bool:
> def get_diff_color_param() -> str:
> return "--color=always" if color_enabled() else "--color=never"
>
> -def print_configs(prompt: str, choices: list[str], descriptions:
> list[str] = []):
> +def print_configs(prompt: str, choices: list[str], descriptions:
> list[str] = None):
While "= None" looks better than "= []", this is still a bit wrong. It
should be:
list[str] | None = None
However, this syntax would require Python 3.10+, so not possible.
Other options could be:
- Dropping the type checks from this function
- Using typing.Optional ?
Regards,
Adrian
> """
> Helper function to print a list of choices and align the output.
> Each option name is made bold to stand out, unless color is not
> enabled in
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#19255):
> https://lists.openembedded.org/g/bitbake-devel/message/19255
> Mute This Topic: https://lists.openembedded.org/mt/118523930/4454582
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/bitbake-devel/unsub [adrian.freihofer@gmail.com
> ]
> -=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 5245 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [bitbake-devel] [PATCH 10/11] bitbake-setup: Set function default to None
2026-03-30 21:49 ` Woolley, Rob
@ 2026-03-30 22:51 ` Richard Purdie
0 siblings, 0 replies; 15+ messages in thread
From: Richard Purdie @ 2026-03-30 22:51 UTC (permalink / raw)
To: rob.woolley, adrian.freihofer@gmail.com,
bitbake-devel@lists.openembedded.org
Cc: alex.kanavin@gmail.com
On Mon, 2026-03-30 at 21:49 +0000, Rob Woolley via lists.openembedded.org wrote:
> Thanks for pointing this out.
>
>
> As far as Python 3.9 is concerned, it went end-of-life on October 31,
> 2025. I recognize that some supported hosts (like Debian 11 and RHEL
> 9) may have it by default. Do we increment the minimum Python
> version when the language runtime goes EOL or when the supported
> hosts do?
This is not an invitation to discuss the minimum python version this
close to release, particularly on a relatively trivial change like
this.
I'd rather just remove the typing than start trying to work out minimum
versions of different systems, how that combines with build tools, the
docs updates needed and so on.
Cheers,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-03-30 22:51 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 18:57 BitBake Linting Errors Rob Woolley
2026-03-26 18:57 ` [PATCH 01/11] bitbake-setup: Remove extraneous variable from str.format() Rob Woolley
2026-03-26 18:57 ` [PATCH 02/11] bitbake-setup: Resolve unused loop control variables Rob Woolley
2026-03-26 18:57 ` [PATCH 03/11] bitbake-setup: Fix ambiguous variable names Rob Woolley
2026-03-26 18:57 ` [PATCH 04/11] bitbake-setup: Remove unused stdout variable Rob Woolley
2026-03-26 18:57 ` [PATCH 05/11] bitbake-setup: Replace f-string without placeholders Rob Woolley
2026-03-26 18:57 ` [PATCH 06/11] bitbake-setup: Remove unused Namespace import Rob Woolley
2026-03-26 18:57 ` [PATCH 07/11] bitbake-setup: Remove unused parser_settings_list Rob Woolley
2026-03-26 18:57 ` [PATCH 08/11] bitbake-setup: Fix linting error related to membership Rob Woolley
2026-03-26 18:57 ` [PATCH 09/11] bitbake-setup: Maintain exception chain Rob Woolley
2026-03-26 18:57 ` [PATCH 10/11] bitbake-setup: Set function default to None Rob Woolley
2026-03-30 16:34 ` [bitbake-devel] " adrian.freihofer
2026-03-30 21:49 ` Woolley, Rob
2026-03-30 22:51 ` Richard Purdie
2026-03-26 18:57 ` [PATCH 11/11] bitbake-setup: Sort and format imports Rob Woolley
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.