175 Commits

Author SHA1 Message Date
Kay Hayen
76994650a7 Tests: Cleanup test case name 2026-01-31 11:30:11 +01:00
Kay Hayen
b4e135ce68 Cleanup, prefer "os.getenv" over "os.environ.get" 2026-01-28 13:47:29 +01:00
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
46527eb455 Cleanup, attach copyright during code generation for specialiations
* This also enhances the formatting for almost all files by making
  leading and trailing new lines more consistent.

* One C file turns out unused, was probably a left over.
2025-10-10 17:05:56 +02:00
Kay Hayen
16401b2346 Tests: Added support for test variants into the test runner
* This is mainly used to cover commercial features,
  but for PGO coverage we can use it too if we provide
  a validation hook.
2025-04-28 11:04:37 +02:00
Kay Hayen
718ab60539 Bump copyright year 2025-04-28 11:04:36 +02:00
Kay Hayen
c565533711 Tests: Make this test clean the dictionary before printing it 2024-12-18 11:37:43 +01: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
4f2cc6ae93 Optimization: Enhanced exception handling
* Use exception state to abstract 3.12 or before differences. This
  solves a TODO about more very in-efficient code generated that
  also requires many conversions of exceptions back and forth from
  3 value form to normalized.

* Moved compile time debug settings to separate file.

* Pass the exception state into unpacking function for more
  efficient code. No need to fetch exceptions per use of
  those into the exception state, but it can directly write to
  there.

* Solve TODO and have helper for unpacking length check. When
  migrating to Python3, this became a custom template with a
  lot of manual code that pre-defined the error messages to
  give too.

* Have our own variant of "_PyGen_FetchStopIterationValue" to
  avoid API calls in generator handling.

* Generate more efficient code for raising exceptions of builtin
  type. Rather than calling them as a function, create them via
  base exception new directly which will be much quicker.

* Faster exception creation, avoid having "args" and a tuple need
  to hole them for empty exceptions avoiding one more allocation.

* Remove uses of "PyTuple_Pack" and replace with our own helpers
  to avoid API calls.

* Avoid implicit exception raise nodes with delayed creation, have
  exception making nodes instead.
2024-12-18 11:09:55 +01:00
Kay Hayen
5d80bd8d03 Tests: Avoid random output from set order for this test 2024-12-18 10:52:22 +01:00
Kay Hayen
695d23ca76 Quality: Updated to latest version of black
* Many improvements, esp. for the ternary expressions
  that are frequently used, they are now formatted
  much better.
2024-12-18 10:51:12 +01:00
Kay Hayen
e6badc3c17 Merge tag '2.0.6' into develop 2024-12-18 10:49:53 +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
30f19c2755 Release: Avoid chinese names in the repo
* These have been seen as preventing installation on some systems
  that are not UTF8 capable.
2024-12-18 10:45:33 +01:00
Kay Hayen
4b016ff015 Tests: Make this directly executable 2024-12-18 10:42:34 +01:00
Kay Hayen
52baffad52 Tests: Added case with Chinese module names
* This was causing issues previously with the star import of a
  module containing non-UTF8 names and "__file__" values in accelerated
  and encoding issues of generated source code not being latin1 as
  it should be.
2024-12-18 10:40:06 +01:00
Kay Hayen
7de21eb195 Tests: Make this directly compile with project options 2024-12-18 10:35:16 +01:00
Kay Hayen
909d41f02d Bump copyright year 2023-06-02 15:07:22 +02:00
Kay Hayen
f83a8244d2 Tests: Was not really applying import check in programs tests 2023-04-16 13:44:59 +02:00
Kay Hayen
fa2af13e01 Tests: Fixup missing importlib for 2.6 on OBS 2023-04-14 13:27:07 +02:00
Kay Hayen
04e00a1d1a Tests: Minor cleanups 2023-04-14 13:27:07 +02:00
Kay Hayen
3c4fdb93b9 Python2: Expose "__loader__" for modules and register with "pkg_resources" too
* Also avoid using "__loader__" from the post module hook, so it's safer
  in case the hooks are not compiled themselves.
2023-04-14 13:23:01 +02: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
3353e9c724 Tests: Fix, older Python was not having all it needs 2022-09-18 11:21:04 +02:00
Kay Hayen
8fd8c35d2e Fix, module code needs to hold a reference to their object. 2022-09-18 10:56:35 +02:00
Kay Hayen
4cfdd9f9c0 Bump copyright year 2022-05-23 10:28:11 +02:00
Kay Hayen
f708d8bade Tests: Enhanced pyproject test to run automatically 2022-05-15 23:11:34 +02:00
Kay Hayen
dea6488815 Plugins: More data file improvements 2022-04-04 15:09:58 +02:00
Kay Hayen
c2e2b6fd58 Plugins: Cleanups to how data files are handled 2022-03-20 13:57:13 +01:00
Kay Hayen
abfb99b0a0 Plugins: Massive cleanup of data file handling
* Move data file handling out of standalone only, allowing support
  for other modes as well.

* Attach logger and tags to data file objects.
2022-03-19 18:10:13 +01:00
Kay Hayen
abbd511f8c Optimization: Added nodes for pkgutil.get_data usage 2022-03-19 18:10:13 +01:00
Kay Hayen
70b7eee955 Python3.7+: Added support for get_resource_reader to our loader
* This allows to avoid a useless file copy to a temporary file
  in case a "importlib.resources.path" is used.

* Also fixed a few typos in tests.

* And avoid compiling the meta path based loader separately, so it
  can use compiled code helpers easily.
2022-03-12 09:02:32 +01:00
Kay Hayen
5f26368b1b Optimization: Allow exclusion of some stdlib modules
* This is in preparation of making following to stdlib the default.

* For now it's used to make multiprocessing plugin not fire in the
  standard configuration.
2022-02-13 13:03:55 +01:00
Kay Hayen
4ac3779f30 Plugins: Make sure the define for multiprocessing is only set when plugin had added module. 2022-02-02 18:20:45 +01:00
Kay Hayen
9d32889d9d Tests: Added project option to make it directly usable 2022-01-16 15:08:09 +01:00
Kay Hayen
2e120382e1 Tests: Do test -m flag with 2.6 where it's badly supported 2022-01-11 10:17:25 +01:00
Kay Hayen
a9d4b99325 Added proper support for "__main__" inside packages and "-m" flag mode.
* The package must be imported and run before the main code to be
  fully compatible.

* Package values and name values differ in these cases from the
  normal setup.

* Enhanced test runner to support variant, so we can run the
  package test as a directory and as a module.
2022-01-09 09:02:02 +01:00
Kay Hayen
081848aadf Tests: Make PGO test runner working
* For two step execution, compilation output is ignored in comparisons.

* Make the scanning for main programs reusable.

* Enhanced test case.
2021-12-21 23:18:31 +01:00
Kay Hayen
e3f4d92e97 Tests: Move program main file detector code to common code 2021-12-07 09:40:03 +01:00
Kay Hayen
5ed76123b8 Tests: Add suite names and minor fixups 2021-12-07 09:38:43 +01:00
Kay Hayen
5a62fd80dd Tests: Do not use multiprocessing plugin unless necessary on the platform. 2021-12-07 09:36:11 +01:00
Kay Hayen
c6ca075439 Tests: Remove obsolete wordings for test runner as well 2021-09-19 16:53:12 +02:00
Kay Hayen
b6e8bba523 Plugins: Add support for multiprocess resource tracker
* This enables support for spawn mode on Linux.

* Make the multiprocessing platform no more limited to Windows.

* Also make sure to exit when forked main exits, that was missing.
2021-09-12 13:59:56 +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
a5386d7f3a Tests: Added test to cover import from submodules of modules that fail to import
* This removes the error after a first round, so it then
  succeeds.

* Also test compatibility with deleting a module from sys.modules
  and seeing behaviour in that case too.
2021-03-27 17:00:23 +01:00
Kay Hayen
e43b72e087 Bump copyright year to 2021. 2021-01-22 09:58:00 +01:00
Kay Hayen
04fe4dbd73 Optimization: Use incbin for including binary data
* This is a header file as an inline copy only, and replaces our tricks
  with the linker, and should make using source code on unknown linker
  arches unnecessary.

* This also fixes issues with LTO linking of extension modules on Linux.

* The created binary with MinGW64 is larger, therefore stick with using
  resources on Windows for now.

* The incbin doesn't work with MSVC there we need the resource mode
  still and ClangCl doesn't work as well.

* To verify constants correctness, pass length and CRC32 hash during
  compilation and check at runtime if they match, that should catch
  build systems that tamper with it.

* Make sure that modules included due to different casing get the
  right constants blob name used.
2021-01-17 15:48:15 +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
8dd8ed93c6 Quality: Updated to latest versions of black and isort 2020-11-02 18:43:05 +01:00