summaryrefslogtreecommitdiffstats
path: root/SCons/Variables/PathVariable.py
Commit message (Collapse)AuthorAgeFilesLines
* Integrate `from __future__ import annotations`Thaddeus Crews2024-11-161-3/+4
|
* Fix ListVariable with a space-containing valueMats Wichmann2024-08-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Minor cleanups in VariablesMats Wichmann2024-06-291-1/+1
| | | | | | | | Continuing the maintenance pass on Variables, these are some minor tweaks for a few checker niggles and fixing up a couple of docstrings. There is no functional change. Signed-off-by: Mats Wichmann <mats@linux.com>
* Allow a Variable to not be substitutedMats Wichmann2024-06-031-1/+1
| | | | | | | | | | New parameter do_subst added to the variables Add method, if false indicates the variable value should not be substituted by the Variables logic. The default is True. Fixes #4241. Signed-off-by: Mats Wichmann <mats@linux.com>
* Variables cleanup: PathVariableMats Wichmann2024-05-131-40/+52
| | | | | | | Part 4 of a series, updating the PathVariable implementation, tests and docstrings. Signed-off-by: Mats Wichmann <mats@linux.com>
* Get rid of raising exceptions entirelyRaymond Li2024-03-281-0/+3
| | | | In favor of just returning status for uniform behavior
* Address review comments on Variables PR (#4031)Mats Wichmann2021-10-081-1/+1
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Tweak Variables incl. manpage, docstringsMats Wichmann2021-10-071-54/+68
| | | | | | | | | | | | | | * 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-42/+36
| | | | | | | | | | | | | | | | | | 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>
* classes no longer explicitly inherit from objectMats Wichmann2020-05-241-1/+1
| | | | | | In Python3 this is the default. 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/+150
with current python packaging practices