41 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
718ab60539 Bump copyright year 2025-04-28 11:04:36 +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
cd3e07f778 Tests: Make big constants test executable for Python3.11+ as well 2024-12-18 10:56:01 +01:00
Kay Hayen
af65a54851 Tests: Avoid using 2to3 in basic and generated tests 2024-12-18 10:56:01 +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
fa2928b4d1 Cleanup: Spelling improvements found by codespell 2024-12-18 10:35:19 +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
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
ba9099fbb0 Minor cleanup
* This was duplicated for no reason.
2022-09-18 11:19:58 +02:00
Kay Hayen
203f4b3ba7 Tests: Added bytes method test
* Most methods are not implemented, but that is about to change.
2022-09-18 11:07:10 +02:00
Kay Hayen
d60072a0b0 Optimization: Added missing str methods, even if less relevant
* This adds "str.expandtabs", "str.translate", "str.ljust",
  "str.rjust", "str.center", "str.zfill", and "str.splitlines".

* While these are barely performance relevant, it's nice to have
  one type, str, complete at least.
2022-09-18 10:58:37 +02:00
Kay Hayen
e0d4e42cd3 Quality: Float imports to top for consistency
* This is a good idea generally, and most needed for generated code.
2022-06-21 08:26:10 +02:00
Kay Hayen
4cfdd9f9c0 Bump copyright year 2022-05-23 10:28:11 +02:00
Kay Hayen
56b1df4fc6 Optimization: Added support for 'str.count' optimization 2022-05-23 10:28:11 +02:00
Kay Hayen
39b76368e3 Tests: Make reference count check work for generated tests 2022-05-23 10:28:11 +02:00
Kay Hayen
3e68abb376 Tests: Check reference counts with method tests 2022-05-19 13:57:04 +02:00
Kay Hayen
40a5c6f8e1 Tests: Enhanced generated tests to cover str keyword arguments
* Also other cleanups for spellings.
2022-05-15 23:11:34 +02:00
Kay Hayen
033f6b5a59 Optimization: Added support for more str builtin methods
* This covers "str.encode" and Python2 only "str.decode".
2021-12-21 23:18:31 +01:00
Kay Hayen
28f0b3f4d0 Optimization: Added support for many str operations
* Firstly , add all methods with no arguments, as these are very generic
  to add, introduced a base class for them, where we know they all have
  no effect or raise, as these functions are all guarantueed to succeed.

* This covers "str.capitalize", "str.upper", "str.lower", "str.swapcase",
  "str.title", "str.isalnum", "str.isalpha", "str.isdigit", "str.islower",
  "str.isupper", "str.isspace", "str.istitle" functions.

* Also add support for 'str.index', 'str.rindex' which is very similar
  to 'str.find', just may raise an exception.

* Also add support for 'str.split' which will be used sometimes for code
  needed to be compile time computed.

* Also add generated test to cover all str methods easily.
2021-12-21 23:17:45 +01:00
Kay Hayen
753b577b59 Optimization: Added support for "dict.update" 2021-12-07 09:40:00 +01:00
Kay Hayen
d2b1f40be5 Optimization: Added support for "dict.pop" as well
* Enhanced generated test output for more clarity with exceptions
  and variations.
2021-12-07 09:38:43 +01:00
Kay Hayen
3817896b68 Optimization: Added support for "dict.setdefault" as well. 2021-12-07 09:38:43 +01:00
Kay Hayen
94abde9438 Optimization: Added support for "dict.has_key"
* This is of course Python2 only, and there is old code still using it.

* The dictionary "in" node was made reusable to make this easy, just
  different evaluation order.

* Generation of nodes wasn't prepared for argument count specific functions yet.

* Add coverage of unhashable values at runtime and compile time to dict
  methods test.
2021-12-07 09:38:43 +01:00
Kay Hayen
87a055f85d Tests: Added generated test that covers dictionary method usages 2021-12-07 09:38:43 +01:00
Kay Hayen
c6ca075439 Tests: Remove obsolete wordings for test runner as well 2021-09-19 16:53:12 +02:00
Kay Hayen
efe207a434 Tests: Cleanup test mode to not use special names
* Far from complete, doing this as we go.
2021-08-09 12:34:30 +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
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
0a993f7e6f Tests: Cover subscript in generated tests, also cover more runtime cases
* Previously the "cond" was always true, now run the function twice,
  once with it true and once false, for more coverage.
2020-11-05 11:50:55 +01:00
Kay Hayen
d5efff09fe Tests: Avoid differences for in-place operations lowered to binary operations.
* When runtime errors for these operations occur, we report the wrong
  operator, namely the binary, instead of the in-place from the source,
  but this doesn't really matter much.
2020-11-05 11:50:53 +01:00
Kay Hayen
3270ecb868 Optimization: Target types for operations and comparisons
* All helpers now have a target type added, mostly OBJECT now, but e.g.
  also NBOOL and CBOOL can be used.

* The helpers for operations are now built with factory functions for their
  consistency

* Added shapes for all operations for the common types.

* Added dedicated nodes for all in-place operations solving a TODO.

* Inplace operations to be created are now derived from the binary
  operations.

* Conversions for missing target types instead of falling back to
  most generic helper.

* Converted manual comparison helpers to new Jinja template for
  generating code automatically.

* Added optimization for more operations and their types, e.g. tuples,
  floats, and more operations.

* More generalized templates to allow more C types that are not objects.

* Added tests to cover in-place operations

* Test infrastructure for generated tests from Jinja2 templates.

* Type shapes are now all instances, avoid mixing classes and instances
  for clarity of code and correctness.

* Enable warnings for all operations in case of specific shape
  combinatations not defined.

* Some corrections to boolean C target type code, now applied in many
  more test cases.

* Proper void C type added, to be used in code specialization later.
2020-05-01 11:33:15 +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
b940ed3384 Tests: Cover more operations in generated tests 2019-09-18 18:03:37 +02:00
Kay Hayen
a906028152 Optimization: Specialize more operations, "%", "<<", ">>", "|", "&", "^"
* This adds support for a lot more operations, striving to become
  more complete in this regard.

* Also give up on special casing node class names for "or", "and", and
  "not", there really is no point, and the new operations were going
  to be affected.
2019-09-18 18:03:37 +02:00
Kay Hayen
7aaa006f80 Tests: Conver more operations and types in generated test. 2019-08-26 08:16:59 +02:00
Kay Hayen
14da200c97 Tests: Added generated tests for operations
* These found some thingss already, and will be expanded to full
  coverage.
2019-08-24 09:32:10 +02:00
Kay Hayen
ee277a0638 Tests: Move generated test to separate runner. 2019-08-12 08:08:24 +02:00