summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-10-21menuconfig: check if current menu is visible in parent when leavingLeandro Lanzieri
This handles a case of leaving a menu which is not shown by the parent menu. This might occur, for instance, when searching for the symbol of a named choice, which is extended by an invisible symbol somewhere else.
2025-10-21kconfiglib: check empty strings on macro expansionLeandro Lanzieri
During macro expansion, bare macros on a line are accepted by the parser as long as they resolve to blank strings. The problem is that the script is currently checking using isspace, so it's actually not checking for blank strings. This causes the parsing to fail when a macro is the last line of a file, and no newline character is added afterwards. This patch adds a check for the string itself being empty.
2025-10-21scripts: menuconfig: proper handling of NULL character as inputTorsten Rasmussen
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/33212 Ignoring when user inputs NULL in a text field. menuconfig exits with a python stack trace if NULL is provided as input character, therefore ignore NULL as an input character to prevent this behaviour. A NULL character may be given accidentally by the user through the following ways: - Pressing `Win` key on keyboard (Windows only) - Pressing `<CTRL>-@` / `<CTRL>-2`. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-10-21Add rudimentary support for modules propertyHelmut Grohne
In linux commit 6dd85ff178cd76851e2184b13e545f5a88d1be30, Linux Torvalds changed "option modules" to plain "modules" since it was the only option left. kconfiglib does not have much support for either besides parsing it and suppressing warnings when it is applied to the 'MODULES' symbol. Mirror this behaviour for the newer "modules" property. Fixes: #106
2025-10-21guiconfig: fix call re lib but not import it.(2)stranding
Co-authored-by: Torsten Tejlmand Rasmussen <torsten.rasmussen@nordicsemi.no>
2025-10-21guiconfig: fix call re lib but not import it.stranding
2025-10-20kconfiglib: add origin testLuca Burelli
This patch adds a test for the origin feature added in the series. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-10-20kconfiglib: track origin for symbol valuesLuca Burelli
Track information about what caused a value to be set in the 'origin' property of Symbol. 'imply' and 'select' dependencies do not have a location associated with them, so in those cases the location is a string representation of the dependency expression. For defaults and user values, the location in the Kconfig file is stored. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-10-20kconfiglib: add loc to reverse dependenciesLuca Burelli
Store the location (filename and line number) where a 'select', 'imply', 'range' or 'default' was added to a Symbol or Choice. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-10-20kconfiglib: add 'user_loc' to Symbol and Choice classesLuca Burelli
The 'user_loc' stores the location (filename and line number) where a symbol or choice was last set via a direct user selection. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-10-20kconfiglib: refactor Kconfig._warn() to use 'loc'Luca Burelli
Replace filename and linenr parameters to _warn() with a single loc element, which is a constant (filename, linenr) tuple that can be more efficiently passed and stored. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-10-20kconfiglib: node: add 'loc' attributeLuca Burelli
Replace 'filename' and 'linenr' usages with a single 'loc' attribute, which is a (filename, linenr) tuple. This simplifies code dealing with locations, and makes it explicitly constant. The original attributes are now provided via properties for compatibility. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-09-23ci: use ubuntu-22.04 runner for python 3.9 testingBenjamin Cabé
GitHub doesn't offer ubuntu-20.04 runners since april 2025 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-23ci: do not test on EOL Python versionsBenjamin Cabé
Python versions < 3.8 are all EOL Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-04Bump to v1.14.1a4v14.1.1a4Stephanos Ioannidis
This commit bumps the package versin to v1.14.1a4. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04setup.py: Add Python 3.9-3.12 classifiersStephanos Ioannidis
This commit adds the classifiers for the Python versions from 3.9 to 3.12 since these versions have been tested to be compatible. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04ci: Add PyPI release workflowStephanos Ioannidis
This commit adds a GitHub Actions CI workflow that tests and builds the Kconfiglib Python package and publishes it to PyPI when a new release is published. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04Update various outdated links and contact informationStephanos Ioannidis
This commit updates various outdated links and contact information throughout the repository. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04README: Update links to point to zephyrproject-rtos repoStephanos Ioannidis
This commit updates all the old 'ulfalizer' Kconfiglib repository links in the README file to point to the new 'zephyrproject-rtos' Kconfiglib repository. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04ci: test: Run macOS Python 3.7 test on macos-12Stephanos Ioannidis
This commit updates the Python test workflow to run the macOS Python 3.7 case on the GitHub runner `macos-12` image, instead of the `macos-13` image because it is (erroneously) missing the ncurses installation as of the version 20240930.147. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04ci: Make workflow concurrency identifier uniqueStephanos Ioannidis
This commit updates the CI workflows such that each workflow has its own unique concurrency identifier prefix. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04ci: Add Python package workflowStephanos Ioannidis
This commit adds a GitHub Actions CI workflow that builds source and built distribution (wheel) packages. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04ci: Add Python test workflowStephanos Ioannidis
This commit adds a GitHub Actions CI workflow that runs the full testsuite with the "release test" script using various Python versions and host operating systems. Note that the testing on Windows host is currently disabled because the test scripts do not correctly handle Windows paths at this time. Also note that Python 2.7 is not tested because it is now archaic and supporting it is pointless. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-10-04reltest: Support custom Python executablesStephanos Ioannidis
The reltest script previously hard-coded the Python executable names, which may vary across different host systems. This commit updates the reltest script to accept custom Python executable name(s) as arguments; if no argument is specified, 'python2' and 'python3' are used by default. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-31Make 14.1.0 release to return message string from Kconfig.write_autoconf()v14.1.0Ulf Magnusson
Adds commit 2a6ac31 ("Return a message from Kconfig.write_autoconf()").
2020-01-31Return a message from Kconfig.write_autoconf()Ulf Magnusson
Like for Kconfig.write_config() and Kconfig.write_min_config(), return a string from Kconfig.write_autoconf() with a message saying that the header got saved, or that there were no changes to it. Can be handy in tools. Also make the "no change" message for the various files more specific, by mentioning what type of file it is (configuration, header, etc.) Return True/False from Kconfig._write_if_changed() to indicate if the file was updated. This also allows it to be reused in Kconfig.write_min_config().
2020-01-24Make 14.0.0 release to use 'python3' in hashbangsv14.0.0Ulf Magnusson
Adds commit 9e0a8d2 ("Use 'python3' instead of 'python' in hashbangs"). This has some breakage potential on older systems (though not when installing via 'pip'), so the major version is increased to 14.
2020-01-24Use 'python3' instead of 'python' in hashbangsUlf Magnusson
It's not obligatory for distributions to have a 'python' binary these days, but 'python3' is likely to be available: https://www.python.org/dev/peps/pep-0394/#for-python-runtime-distributors. Change all hashbangs to point to 'python3'. This will break running $ ./script.py on *nix systems that don't have a 'python3' executable. Changing it to $ python script.py is pretty painless at least. This change won't break Python 2 when installing via 'pip', because entry_points creates bounce scripts with their own hashbangs. The major version will be increased, in case someone looks at the major version but doesn't install via 'pip'. Fixes: #89
2020-01-12Make 13.7.1 release to work around macOS menuconfig resizing crashv13.7.1Ulf Magnusson
Adds commit 68bcecd ("menuconfig: Work around crash on resize on some macOS systems").
2020-01-12menuconfig: Work around crash on resize on some macOS systemsUlf Magnusson
get_wch() has started raising curses.error when resizing the terminal on some macOS Python installations. Work around for now by falling back on getch(), which still works. See https://github.com/ulfalizer/Kconfiglib/issues/84. Needs more investigation, but I don't have a Mac handy. Based on https://github.com/ulfalizer/Kconfiglib/pull/85, but with some more comments.
2020-01-12Fix _parse_block() comment re. next pointerUlf Magnusson
It's not the 'next' attribute of the node that's added that's set, but the 'next' attribute of the node before it.
2020-01-12Remove heavy page warning for Kconfig symbol reference in ZephyrUlf Magnusson
No longer links to a heavy page after the reference was split up.
2020-01-12guiconfig: Shorten _sorted_sc_nodes() a bitUlf Magnusson
Makes it consistent with menuconfig.py.
2020-01-12Make help for Kconfig file argument consistent in toolsUlf Magnusson
Say 'top-level' instea of 'base'.
2020-01-12menuconfig: Remove some double blank linesUlf Magnusson
Clear enough with the comment style. Shortens things a bit.
2020-01-12Put some comments at the end of lines.Ulf Magnusson
Shortens things a bit.
2019-12-22Make 13.7.0 releasev13.7.0Ulf Magnusson
Adds commit 87fab02 ("Add "error: " to the error message for a missing endchoice/endif/endmenu").
2019-12-22Remove redundant 'node.next = None' assignment for the last node in a fileUlf Magnusson
A node already gets its .next pointer set in _parse_block() if it is either 1. followed by another node, or 2. the last node in a menu, choice, or if. This also works for nodes from 'source'd files, so there's no need to special-case the ends of them. Remove the 'node.next = None' assignment for ends of files. Instead, special-case just the last node in all files, and set its .next to None in Kconfig._init(). Unlikely to give a noticeable performance improvement. Just tightens up the chaining logic a bit.
2019-12-22Add "error: " to the error message for a missing endchoice/endif/endmenuUlf Magnusson
Makes it consistent with other parse errors and easier to find in logs, etc.
2019-12-21Fix typo in commentUlf Magnusson
2019-12-19Make 13.6.0 release to improve aquatic themev13.6.0Ulf Magnusson
Adds commit 456f821 ("menuconfig: Improve look and readability of the aquatic theme").
2019-12-19menuconfig: Improve look and readability of the aquatic themeUlf Magnusson
Cyan-on-blue for the path/help text is hard to read, especially on some terminals. Also remove bold, which looks a bit cleaner at a glance.
2019-12-17Pass 'node.item' instead of 'node' to Kconfig._set_type()Ulf Magnusson
'node' isn't needed. Shaves some lookups.
2019-12-17Make 13.5.0 release to include script name for suppress_traceback=Truev13.5.0Ulf Magnusson
Adds commit 24a0204 ("Include sys.argv[0] in error messages when suppress_traceback=True").
2019-12-17Include sys.argv[0] in error messages when suppress_traceback=TrueUlf Magnusson
Handy to have the script name appear in logs.
2019-12-17Remove pointless return in Kconfig.__init__()Ulf Magnusson
Oversight.
2019-12-17Rename _make_depend_on() to _depend_on()Ulf Magnusson
Shorter, clear in context.
2019-12-17Rename _parse_properties() to _parse_props()Ulf Magnusson
Shorter, clear in context.
2019-12-14Make link to Kconfig tips page easier to spotUlf Magnusson
Move it into the step-by-step getting started instructions.
2019-12-14Make 13.4.0 release with error reporting and listnewconfig improvementsv13.4.0Ulf Magnusson
Error reporting improvements: - Commit 1ec9170 ("Add Kconfig.__init__() helper flag for suppressing tracebacks") - Commit 2122d5d ("Include "error: " in parsing error messages") listnewconfig improvement: - Commit 7e6b9cf ("listnewconfig: Add option for showing help texts") Also includes a load_allconfig() API improvement: - Commit c2414bd ("Add a member function version of load_allconfig()")