summaryrefslogtreecommitdiffstats
path: root/SCons/Variables/PackageVariable.py
Commit message (Collapse)AuthorAgeFilesLines
* Update NEXT_RELEASE to 4.9.0William Deegan2025-03-021-1/+1
|
* Integrate `from __future__ import annotations`Thaddeus Crews2024-11-161-4/+6
|
* PackageVariable now returns the default on "true"Mats Wichmann2024-09-041-21/+29
| | | | | | | | | | | | | | In all doc versions until 4.8.0, PackageVariable had wording like: "The option will support the values yes, true, on, enable or search, in which case the specified default will be used", but the code didn't actually do that, it just returned True. With this change it now returns the default value, with a slight tweak - if the default is one of the spelled out enabling strigs, it returns the boolean True instead. The indication that the default is produced if a truthy string is given is restored to the manpage (it was never dropped from the User Guide). Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix ListVariable with a space-containing valueMats Wichmann2024-08-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix ListVariable handling of a quoted variable value containing spaces. As a side effect of splitting the former monolithic converter/validator for ListVariable into separate callbacks, it became possible for subst to be called twice. The ListVariable converter produces an instance of a _ListVariable container, and running subst on that result ends up losing information, so avoid doing so. While developing a test for this, it turned out the test framework also didn't handle a quoted argument containing a space, so that a test case passing arguments to scons via "run(arguments='...')" could end up with scons seeing a different (broken) command line than scons invoked with the same arguments typing to a shell prompt. A regex is now used to more accurately split the "arguments" parameter, and a unit test was added to the framework tests to validate. The framework fix had a side effect - it was possible that when run as part of the test suite, the Variables package could receive a value still wrapped in quotes, leading to string mismatches ('"with space"' is not equal to 'with space'), so ListVariable now strips wrapping quote marks. Also during testing it turned out that the earlier fix for #4241, allowing a Variable to declare the value should not be subst'd, introduced problems for two types which assumed they would always be passed a string. With subst=False, they could be passed a default value that had been specified as a bool. Fixed to not fail on that. Fixes #4585 Signed-off-by: Mats Wichmann <mats@linux.com>
* Variables cleanup: PackageVariableMats Wichmann2024-05-101-21/+37
| | | | | | | Part 3 of a series, updating the EnumVariable implementation, tests and docstrings. Signed-off-by: Mats Wichmann <mats@linux.com>
* Address review comments on Variables PR (#4031)Mats Wichmann2021-10-081-5/+7
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Tweak Variables incl. manpage, docstringsMats Wichmann2021-10-071-40/+41
| | | | | | | | | | | | | | * Added link anchors in variables-related funcs/methods, and link to them - these methods are not part of the generated link setup. * Clarified that vars set to defaults are not saved. * Updated docstrings in the Variables source (for API docs). * Added return-type annotations to Variables. * Fix for converter function possibly failing if it tries to access an environment. Fixes #2064. * Fixed up the behavior of aliases to variables, and added docu. Fixes #3869. * Fix PathIsDirCreate validator to catch permission problems. Fixes #2828 Signed-off-by: Mats Wichmann <mats@linux.com>
* Update some copyright strings and drop __revision__ [skip appveyor]Mats Wichmann2020-09-231-28/+26
| | | | | | | | | | | | | | | | | | Touches the first and second levels of SCons (except SCons.Tool), not tests or docs which remain TODO. Make sure docstring is first non-comment content, eliminate cases where docstring is set elsewhere but assigns to __doc__ - this approach of course worked inside Python, but confuses various tools. Some module-level docstrings modified a bit, in particular the convention of having the name of the module as the first line is dropped, replaced by a summary description going there instead - this improves the look in the API Docs, which otherwise display something like: SCons.Foo - SCons.Foo Signed-off-by: Mats Wichmann <mats@linux.com>
* Minor: drop engine prefix from docstrings [ci skip]Mats Wichmann2020-06-111-1/+1
| | | | | | | | A number of module docstrings start with the module name, these end up appearing in API docs. Drop the "engine/" prefix where it appears. Signed-off-by: Mats Wichmann <mats@linux.com>
* Reorganize the repo. Moved src/engine/SCons to ./SCons to be more in line ↵William Deegan2020-05-061-0/+106
with current python packaging practices