summaryrefslogtreecommitdiffstats
path: root/SCons/BuilderTests.py
Commit message (Collapse)AuthorAgeFilesLines
* Integrate `from __future__ import annotations`Thaddeus Crews2024-11-161-3/+8
|
* Implement framework for hinting complex typesThaddeus Crews2024-01-151-2/+3
| | | | • Showcase potential with `ExecutorType`
* Allow PathLib objects in sourcesMats Wichmann2023-08-231-0/+34
| | | | | | | | | | | | Changes BuilderBase._adjustixes() to try converting the files arguments to path string - in a way that doesn't flip an existing SCons Node back to a string. Unittest for _adjustixes is added to validate. Fixes #4398 Signed-off-by: Mats Wichmann <mats@linux.com>
* Followon to PR #4348: more bool fixesMats Wichmann2023-06-161-3/+3
| | | | | | | | | | | | | | Manually fixed up some things related to bool, e.g. simple functions which just did "return 1" were interpreted by the tool as returning int, when bool was really the intent. Functions/methods named like "is*", "has*", "exists", "rexists" (and others) are now pretty consistently marked as returning bool. A couple of minor alignments of branched definitions, and a couple of docstring adjustments made. If Tools which had old heading style were touched, they got the new style. Signed-off-by: Mats Wichmann <mats@linux.com>
* Add some cheap return and parameter annotationsMats Wichmann2023-05-011-72/+72
| | | | | | | | | | | | | | | | | 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>
* Change SCons.Scanner.Base to ScannerBaseMats Wichmann2021-10-041-1/+1
| | | | | | | | | | Maintenance: SCons has multiple classes named Base, which is a bit unfortunate. Some already use a context-qualified name, like BuilderBase, which seems preferable. Do that for ScannerBase, but leave the name Base in the SCons.Scanner package in case *external* users are depending on SCons.Scanner.Base working. SCons internally no longer uses that name. Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix some imports and other checker warningsMats Wichmann2021-05-051-1/+0
| | | | | | | | | | | | | * Removed a number of imports reported as unused. * Reorganize imports in a few places. * Checker reported warnings problems ("Instantiating an exception, but not raising it, has no effect"): serveral tool modules instantiated a warning class thinking (?) it would issue the warning; changed these to the standard use - calling the warn() function with the warnclass as an arg. * Tool modules that were touched had the copyright header munging applied. * Removed irritating "####" lines from gettext and msgfmt tools. Signed-off-by: Mats Wichmann <mats@linux.com>
* Drop dictionary has_key references: Py2-ism.Mats Wichmann2021-03-111-4/+2
| | | | | | | | | | | | | | In some cases, added a __contains__ method instead, not because it necessarily was needed, but for completeness. Also one completely unrelated change because it happened to be sitting modified in the tree when I committed modified files: be a little more cautious about building CHECK_METHODS in our subclassing of the optparse Option class... current cpython starts it at None, then fills it in, so it shouldn't be None when we subclass. Signed-off-by: Mats Wichmann <mats@linux.com>
* Work around Py3.10 optimizing out a builder testMats Wichmann2021-01-121-5/+12
| | | | | | | | | | | | BuilderBase class traps __bool__ call and raises InternalError. On Py 3.10a the unit test for this got optimized out, avoid this. While we're at it, eliminate remaining references to __nonzero__, which was a Py2-ism, replaced by __bool__. Closes #3860 Signed-off-by: Mats Wichmann <mats@linux.com>
* Update some copyright strings and drop __revision__ [skip appveyor]Mats Wichmann2020-09-231-3/+2
| | | | | | | | | | | | | | | | | | 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>
* Simplify more tests to use unittest.mainMats Wichmann2020-08-251-10/+1
| | | | | | | For issue #3113, but does not complete it - there are still uses of TestSuite where the "simple fix" from the issue requires more thought. Signed-off-by: Mats Wichmann <mats@linux.com>
* classes no longer explicitly inherit from objectMats Wichmann2020-05-241-9/+9
| | | | | | 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/+1635
with current python packaging practices