103 Commits

Author SHA1 Message Date
Kay Hayen
0ac329ec01 Scons: Changed error message for using MinGW64 on newer Python to also mention Zig
* Also enhanced reporting error exit reporting through the scons logger to provide
  the exception in the compilation report.

* More error exits in scons should do this.
2026-01-28 13:44:29 +01:00
Kay Hayen
dbeb5336d8 Cleanups
* Avoid imports of whole modules and instead import only select names
  from them.

* For the nuitka.Options module we split off the states into a separate
  "nuitka.States" module that provides an object that is also faster
  to access that module attributes. This is a micro optimization that
  allows their use to be faster.

* Renamed XML reading/creating functions for clearer names when used
  with out the module name, same for source code references objects.
2026-01-28 13:36:41 +01:00
Kay Hayen
718ab60539 Bump copyright year 2025-04-28 11:04:36 +02:00
Kay Hayen
5e3c5a4a0d UI: Replace uses of "--module" with "--mode=module"
* Also the new "--mode=package" wasn't considered in
  a few places in our testing framework.
2025-04-28 11:04:38 +02:00
Kay Hayen
4a0a21ff98 Tests: Remove 2to3 conversion code, we don't want to use it anymore 2024-12-18 11:10:21 +01:00
Kay Hayen
f9c2b8d07e Tests: Make sure file names of optimization tests clearly indicate they are tests 2024-12-18 10:51:39 +01:00
Kay Hayen
f34f8d0c63 Bump copyright year
* Also split copyright notices between the top and bottom,
  such that readability of just opened files is not harmed
  by license text.
2024-12-18 10:48:16 +01:00
Kay Hayen
8ff037dbd3 Reports: Be explicit about wanted encoding 2024-12-18 10:40:06 +01:00
Kay Hayen
7cd07e6283 Optimization: Enhanced handling of aliased variables
* Was not converting variable assignments from variables created
  during re-formulations to the dedicated nodes, potentially missing
  out on optimizations specific to that case, because it was then
  not recognized to be non-generic anymore later.

* Was not optimizing comparisons and truth checks for temporary
  variable references, missing out on these opportunities, e.g.
  with match statements.

* When a variable is aliased, but the source variable is one that
  cannot escape or is even very hard, we were not annotating that
  as well as we can, now e.g. comparisions with constant values that
  are immutable are done even if aliased.

* Remove knowledge of variables assigned to other variables only if
  that can escape, otherwise that has no real point.
2024-12-18 10:38:49 +01:00
Kay Hayen
72a2c05a63 Quality: Updated requirements
* New black removes a few leading new lines in blocks, so many
  files changed in that way.

* The "pygments" has a vulnerability, but updating that and the
  restructured text checking stuff did not actually matter at
  all.

* Bumped needed version for development to 3.8, since black does
  not do 3.7 anymore, and it's old enough.
2024-01-22 21:40:07 +01:00
Kay Hayen
909d41f02d Bump copyright year 2023-06-02 15:07:22 +02:00
Kay Hayen
935e983860 Minor cleanups 2023-02-13 14:20:27 +01:00
John Vandenberg
5d15c7c704 Quality: Update and expand auto-formatting tools
* Update auto-formatting tools with newest isort and rstfmt.

* Also format of "tests/*/*.rst" and many test files.
2023-02-13 14:20:27 +01:00
Kay Hayen
4968773f3d Optimization: Massive generated children mixin work.
* All expression nodes now use a dedicated generated children mixin
  class, aimed at optimal use.

* Some select expression nodes now use dedicated base classes with
  automatic computations done in there.

* When cloning nodes or getting visitable nodes, more more compact
  code is used that should perform better.

* Named chilren now have types, and "tuple" is handled explicitely
  without checking values for their type, so updates, iteration etc.
  is all directl.

* Remove useless checker for "kw_defaults" from function creation nodes,
  they are only ever "None" when the node is created. No need to check
  afterwards anymore.

* Only when a function node is created, is there a chance for "kw_defaults"
  to be empty dict, so use a factory function instead.

* With useless checkers removed, generated children mixins now do apply
  the checkers statically rather than checking on every update if there
  is one, and the checkers dictionary per expression can be dropped as
  result, making things perform much better for child replacement.

* Attach type shapes to methods specs for use in attribute node
  generation, such that the proper mixin class for the result
  type shape can be chosen automatically, but we do have some types,
  that depend on Python version looking at it, and won't be suitable yet.

* Factories for nodes are now detected automatically in node generation,
  making them easier to use.

* Added support for "importlib.metadata.entry_points" and its
  backport variant "importlib_metadata" too.

* Added operations for all "bytes" methods as well, such that the
  existing few ones are automatically generated as well.

* Added "auto_compute" for annotations of nodes that never change and do
  annotate and potentially raise an exception or not. This will allow to
  do stub method implementations, and rather have the base class contain
  this directly.

* The "iter" node for 2 arguments was not annotating its exception exit,
  which was discovered when looking for a boiler plate node to migrate
  to "auto_compute" which then of course resolves the bug.

* Make sure we pass tuple values when creating nodes that have children
  with that type. We created node lists only to always convert them to
  tuple value when the node is created. This is now avoided in many
  cases.

* Sequences had dead attribute "sequence_kind", removed that attribute.

* Made a new sequence mixin for reuse in "importlib.metadata.EntryPoints"
  values which are more or less a sequence derived class.

* Made dictionary mixin for reuse in "importlib.metadata.SelectableGroups"
  as these are more or less a dict derived class.

* Replaced "willRaiseException" with "willRaiseAnyException" which will be
  more accurate and faster, and matches what the result of the function
  is more closely anyway. We do not ask the other question at all yet.

* Remove useless raise checks in sequence making nodes, they were
  repeating the effort done in the base class for no good reason,
  potentially wasting a lot of time.

* Made meta data using test cover the new entry_points method without
  arguments at least.
2023-01-09 16:44:30 +01:00
Kay Hayen
e983f55f0b Quality: For files split with isort ensure newline for second part 2022-09-19 10:52:58 +02:00
Kay Hayen
a816947fd0 UI: Allow doing the XML dump to a file, and have it done in addition
* Instead of trying to keep stdout clean in order to not break
  the XML parsing, this is more robust, and avoids the need to
  redirect the output.

* With --generate-c-only the C compilation can still be avoided,
  but code is generated always, adapted the test to require that.
2022-09-18 11:21:45 +02:00
Kay Hayen
c8332a2878 Optimization: Specialize variable assignment statements depending on source type
* Constant values are the only ones that need to check their propagation right now.

* Iterators will be interesting for iterator tracing.

* Assignments from variables are also the only ones to do certain
  checks.
2022-06-07 19:21:27 +02:00
Kay Hayen
328ecd6574 Tests: Do PYTHONPATH update with common code 2022-05-26 08:28:29 +02:00
Kay Hayen
4cfdd9f9c0 Bump copyright year 2022-05-23 10:28:11 +02:00
Kay Hayen
995c0c668a Tests: Better outputs for optimization test failures 2022-05-15 23:11:34 +02:00
Kay Hayen
abbd511f8c Optimization: Added nodes for pkgutil.get_data usage 2022-03-19 18:10:13 +01:00
Kay Hayen
1fef78eab2 Optimization: Also use very trusted module variables on function level
* With this, "sys" attributes etc. are also resolved in functions.

* Also add "sys.platform", "sys.maxsize", and "sys.hexversion" as
  trusted constants.

* For Python2, add "sys.subversion" and "sys.maxint" as trusted
  constants specific for that version.
2021-12-07 09:47:11 +01:00
Kay Hayen
5ed76123b8 Tests: Add suite names and minor fixups 2021-12-07 09:38:43 +01:00
Kay Hayen
c497438a46 Minor cleanups
* Remove useless usages of isort:skip
2021-12-07 09:38:42 +01:00
Kay Hayen
9ecfd2c701 Optimization: The shapes of star arguments are known of course 2021-09-12 13:53:36 +02:00
Kay Hayen
33dde35bd3 Tests: Fix, the "only" mode wasn't working well
* Also cleanup the API, tests should not have to abort.
2021-04-06 13:40:22 +02:00
Kay Hayen
7f313f2b07 Quality: Bump requirements, esp. pylint to latest
* Addressed new warnings and removed a few annotations in __past__ module that
  were there for being checked with Python2 which we no longer do.

* Turned a few constant checking branches into proper TODOs.
2021-03-13 11:28:34 +01:00
Kay Hayen
60d55ba087 Optimization: Enhanced future import optimization
* Allow these to become hard imports as well.

* For hard name imports, generate more efficient code.

* Should give slightly less complex C code and less exception exits.
2021-02-21 01:22:55 +01:00
Kay Hayen
e43b72e087 Bump copyright year to 2021. 2021-01-22 09:58:00 +01:00
Kay Hayen
dd5a9f2dd5 Cleanup, avoid decimal and string comparisons for version checks
* This is in preparation for 3.10 which will fail to work that work.

* Extended numeric values to be hexadecimal.

* Using tuples over strings in testing.
2020-12-17 09:06:53 +01:00
Kay Hayen
53862182ea Onefile: Add support for single file distribution on Linux
* This uses AppImage to create the executable.

* The output from AppImage is too confusing for Nuitka target audience,
  thefore silence it.

* Also provide general traces from Nuitka for other stages as well.

* An icon will be needed, but currently, only a hardcoded one can be
  specified.
2020-11-05 11:50:55 +01:00
Kay Hayen
9b13be4752 Optimization: Provide shape, side effect, and specialization for slice
nodes

* We only had one common node, lets split this up into a variant with
  only 2 arguments, to save memory when using it and a bit of the
  processing during optimization.

* We didn't say that we know the shape type for these, so that was
  added.

* And as for side effects, creating slice objects doesn't have any,
  so make this clear.
2020-11-05 11:50:54 +01:00
Kay Hayen
d99caf3522 Optimization: Annotate more shapes consistenly
* This uses mixins, which do the typical slot behavior.

* Also adding a slot for hash ability, to be used for operations so far.

* The mixin added can be used in other nodes as well in the future.
2020-11-05 11:50:53 +01:00
Kay Hayen
128e93f935 Quality: Upgraded to newer black.
* Unpacking to single arguments is something we use, this makes it more
  clear with braces.

* Unpack to multiple arguments is now displayed much cleaner.

* Multiline imports are used more often at least.
2020-05-01 11:33:24 +02:00
Kay Hayen
93184f9bd7 Tests: Remove useless output for search and only modes
* The skipping due to not being active output a lot of names
  for no good reason.
2020-03-01 21:23:28 +01:00
Kay Hayen
b2083575cf Bump copyright year to 2020. 2020-02-01 07:42:45 +01:00
Kay Hayen
54d1c27c7f Minor cleanups
* Some format issues for generated codes again

* Newer PyLint findings

* Frame handling differences for 3.7 hidden behind macro.
2019-12-16 08:59:17 +01:00
Kay Hayen
53ca775a36 Tests: Minor cleanups 2019-08-04 18:54:45 +02:00
Kay Hayen
717247f51a Tests: Move this test to the correct place. 2019-08-01 01:01:20 +02:00
Kay Hayen
4ef3575ab3 Minor cleanups 2019-08-01 01:01:20 +02:00
Batakrishna Sahu
5eae90fc5d Optimize the "all" built-in (#407)
Optimization: Added support for the "all" built-in
2019-07-27 20:20:40 +02:00
Kay Hayen
54200ed787 Tests: Make sure test runners are pylint and autoformatted too.
* The autoformat had been done partially in the past, but now it
  is complete.

* Covering it with pylint makes sense, but required a lot of
  small changes.
2019-07-08 14:06:57 +02:00
Kay Hayen
5a276dd96e Tests: Fix typo related to coverage tests. 2019-07-08 14:06:57 +02:00
Batakrishna Sahu
b3f5a542a2 Tests: Add search mode "All" (#378)
* Added search mode All

* Added "onErrorDetected()" method to let search mode decide

* Fixes for missing "# isort:start" and autoformat doing runners
2019-07-08 14:06:57 +02:00
Batakrishna Sahu
d8000327ab Tests: Added support for only mode in Test runners (#333) 2019-04-05 09:53:01 +02:00
Kay Hayen
ea43312094 Tests: Cleanup names of test functions to express their nature. 2019-03-21 21:33:09 +01:00
Kay Hayen
c65ecb16f8 Tests: Make it more clear how the test is used.
* Also cleanup naming a bit.
2019-03-07 08:12:44 +01:00
GirijaManoj
856b38bf86 Tests: Added functions for all the operations (#286)
Finished functions for all the operations that were mentioned in the TODO list.
2019-03-05 08:10:00 +01:00
GirijaManoj
5c86712998 Tests: Cover more subscripts (#287)
Updated the file with few more different types of subscripts that python allows i.e Added 3 argumented subscripting and also added negative indiced subscripting. To make sure that we are not missing any minute details.
2019-03-02 12:26:33 +01:00
Kay Hayen
47c99d377e Bump copyright year to 2019. 2019-01-24 16:28:13 +01:00