summaryrefslogtreecommitdiffstats
path: root/SCons/Executor.py
Commit message (Collapse)AuthorAgeFilesLines
* Integrate `from __future__ import annotations`Thaddeus Crews2024-11-161-5/+5
|
* Implement framework for hinting complex typesThaddeus Crews2024-01-151-3/+5
| | | | • Showcase potential with `ExecutorType`
* "Modernize" to Python 3.6 via toolMats Wichmann2023-08-041-2/+2
| | | | | | | | | | | | | | | | | | | | | $ pyupgrade --py36-plus $(<filelist) Here's mostly what it's done: - No more 'stringliteral'.encode('utf-8'): now b'stringliteral' - No more unicode literals - the default open mode is 'r', leaves out if default - some f-string conversions (if shorter) - catch OSError instead of subclasses - no more mention of "object" - generator expression instead of list comp. when safe - a few tests had a shebang but actually began with blank line - remove coding: utf-8 comment, per pep 3120 this is the default now Manually - if a file in test/ was modified, then did the copyright header conversion. Signed-off-by: Mats Wichmann <mats@linux.com>
* Add some cheap return and parameter annotationsMats Wichmann2023-05-011-32/+32
| | | | | | | | | | | | | | | | | 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>
* Obtain a small perf win by using types that iterate faster for childrenAndrew Morrow2022-10-191-6/+6
|
* Fix some imports and other checker warningsMats Wichmann2021-05-051-4/+2
| | | | | | | | | | | | | * 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>
* Some code modernizatoionMats Wichmann2021-05-031-4/+0
| | | | | | | | | Remove obsolete __getslice__ and __setslice_ definitions add Node.fs.scandir to call new (Py3.5) os.scandir Node.fs.makedirs now passes the exist_ok flag Cachedir creation now uses this fs.makedirs with exist_ok=True Signed-off-by: Mats Wichmann <mats@linux.com>
* Update some copyright strings and drop __revision__ [skip appveyor]Mats Wichmann2020-09-231-9/+4
| | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | In Python3 this is the default. Signed-off-by: Mats Wichmann <mats@linux.com>
* Eliminate Py2-compat with_metaclass jigMats Wichmann2020-05-131-3/+3
| | | | | | | | | | | SCons has used a wrapper trick because the way a class declares it uses a metaclass differs between Py2 and Py3. Drop this usage and list the metaclass the Py3 way. Along the way, stop reusing the type class name as a parameter, as it might be confusing (SCons and packaging). 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/+671
with current python packaging practices