summaryrefslogtreecommitdiff
path: root/SCons/Script/SConscript.py
Commit message (Collapse)AuthorAgeFilesLines
* Add some cheap return and parameter annotationsMats Wichmann2023-05-011-11/+11
| | | | | | | | | | | | | | | | | Use: https://github.com/JelleZijlstra/autotyping to add "safe" return annotations. Where a parameter has a default value that is an obvious scalar type (bool, int, str, etc.) add those annotations as well. Also fixed two small bugs that popped up when sanity-checking with mypy. One in FortranCommon, where a return had been previously annotated to be a tuple of Action, which should be ActionBase - Action is the factory function, not the base class. The other was a typo in the error raised in _add_cppdefines - the message was formatted with the value of "define" which should have been "defines". Signed-off-by: Mats Wichmann <mats@linux.com>
* Do not initialize DefaultEnvironment onAnatoli Babenia2022-09-151-3/+6
| | | | Exit(), GetLaunchDir() and SConscriptChdir()
* Remove unused private method SConsEnvironment._exceeds_version()Anatoli Babenia2022-09-151-5/+0
|
* doc: change five functions to appear global-onlyMats Wichmann2022-09-141-6/+6
| | | | | | | | | | | | | The five functions EnsureSConsVersion, EnsurePythonVersion, Exit, GetLaunchDir, SConscriptChdir were listed as both global and environment functions, but they do nothing in the context of an environment, so marked in the xml as "global". This only changes the presentation in the manpage & userguide appendix, not the behavior. Minor tweaks in the code around SConscriptChdir - actually use a bool True/False instead of 0/1, and added a couple of type annotations. Signed-off-by: Mats Wichmann <mats@linux.com>
* Make EnsurePythonVersion static tooAnatoli Babenia2022-09-041-1/+2
|
* Exec `EnsureSconsVersion` without init of default environmentAnatoli Babenia2022-09-041-3/+5
|
* Add ValidateOption() API which validates that all command line options are ↵William Deegan2022-08-131-0/+1
| | | | either SCons specified or specifie by AddOption calls. It will error out if there are any unknown options. Resolves Issue #4187
* Change warnings behavior of missing SConscriptMats Wichmann2021-06-181-13/+19
| | | | | | | If SConscript() is called with must_exist=False, accept the user's will without issuing a warning about the file being missing. Signed-off-by: Mats Wichmann <mats@linux.com>
* [PR #3884] fix some timinng errors from initial submitMats Wichmann2021-02-091-3/+3
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Add timing of sconsign write if --debugMats Wichmann2021-02-081-3/+2
| | | | | | | | | | | A line is now emitted showing sconsign sync time if --debug=time Some calls to time.time replaced with time.perf_counter, where the objective was to time sections of code (i.e. where there wasn't an actual need to get time-since-epoch) - Python recommends this as getting the best-available timer. Signed-off-by: Mats Wichmann <mats@linux.com>
* cleanup whitespaceWilliam Deegan2021-01-211-0/+1
|
* Update some copyright strings and drop __revision__ [skip appveyor]Mats Wichmann2020-09-231-9/+3
| | | | | | | | | | | | | | | | | | 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>
* Run autoflake on codeMats Wichmann2020-09-211-1/+0
| | | | | | | | | | Eliminate unneeded imports, and a few unneeded statements - usually "pass" where it is not syntactically needed. A couple of import try blocks were eliminated or changed when they're "cannot happen" due to current floor Python version. Signed-off-by: Mats Wichmann <mats@linux.com>
* Conditionally suppress deprecation message.Joachim Kuebart2020-08-111-1/+1
| | | | Suppress missing SConscript deprecation message when must_exist is used.
* added is_sconscript for checking if node is a sconscript node or notDaniel Moody2020-06-041-1/+2
|
* classes no longer explicitly inherit from objectMats Wichmann2020-05-241-2/+2
| | | | | | 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/+686
with current python packaging practices